如何使用Spring Cloud函数为使用Java的Http请求调用谷歌云函数

问题描述

我正在尝试使用 Spring Cloud Function for Http Request 实现 Google Cloud Function,但是我找不到任何可以帮助我理解如何处理 Http Request 的示例示例。在 AWS 中,我们有 APIGatewayProxyRequestEventAPIGatewayProxyResponseEvent,如下所示:

    @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 只解释了如何读取字符串并响应字符串。如果我必须阅读 Http Request 并映射到 Google Http Request 并使用 Google Http Respond 响应怎么办?我们如何使用 Spring Cloud Function for Http Request 在 GCP Cloud Function 中创建类似的函数

文档中没有解释 GCP Cloud Function 与 Spring Cloud Function 集成的文章

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)