2

I'm trying to implement Google Cloud Function using Spring Cloud Function for Http Request, but I couldn't find any sample example which can help me to understand how to handle Http Request. In AWS we have APIGatewayProxyRequestEvent and APIGatewayProxyResponseEvent as shown below:

    @Bean
    public Function<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> processXmlOrder() {
      return value -> {
        try {     
          APIGatewayProxyResponseEvent responseEvent = new APIGatewayProxyResponseEvent();
          responseEvent.setStatusCode(201);
          responseEvent.setBody(objectMapper.writeValueAsString(order));
          return responseEvent;
        } catch (IOException e) {
          ......
        }
      };
    }

Documentation example only explains how to read a string and response the string. What If I have to read Http Request and map to Google Http Request and Respond with Google Http Respond? How can we create similar function in GCP Cloud Function using spring Cloud Function for Http Request?

There are no articles in the documentation which explains GCP Cloud Function integration with Spring Cloud Function.

Serhii Rohoza
  • 4,287
  • 2
  • 16
  • 29
Atul
  • 21
  • 2

0 Answers0