首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用网关从Spring Integration应用程序使用Spring Boot应用程序

使用网关从Spring Integration应用程序使用Spring Boot应用程序
EN

Stack Overflow用户
提问于 2018-04-12 03:46:46
回答 1查看 131关注 0票数 1

我刚刚开始使用Spring Boot2与Spring集成。

我正在开发一个使用Spring Integration的HTTP出站网关来使用Spring启动服务的应用程序。

我正在使用Gateway从spring Integration应用程序使用Spring启动服务。

当我调用Gateway方法时,该方法将使用出站网关来调用spring引导服务,请求似乎没有完成。当我通过浏览器发出HTTP GET请求时,它正在进行。

Spring Boot服务也不会接收到该请求。

在使用网关使用Spring Boot2服务时,我无法识别Integration应用程序中的错误所在。

我已经在下面的github文件夹中分享了我的Spring Boot 2应用程序和我用来消费它的Integration应用程序。它包含两个文件夹,一个用于spring Integration应用程序,另一个用于spring boot应用程序。https://github.com/gsamartian/spring-int-demos

我已经使用RestController为集成应用程序公开了一个REST接口。

我通过url http://localhost:8763/callExternalServiceViaGateway从集成应用程序访问引导应用程序

我可以直接从spring boot应用程序的端口访问它。

如果有人能帮我找出原因,那就太好了。

谢谢,

EN

回答 1

Stack Overflow用户

发布于 2018-04-12 04:38:19

网关方法没有任何参数的问题:

代码语言:javascript
复制
@Gateway(requestChannel = "get.request.channel", replyChannel = "reply.channel")
String getCustomMessage();

在这种情况下,网关作为接收工作。不发送任何请求,因为没有要包装到payload的内容。请在Reference Manual中查看有关此问题的更多信息。

现在,我发现payloadExpression有几个bug,但没有arg,所以我建议您在getCustomMessage()网关方法中添加一些String payload arg,并使用空字符串执行它。

将研究一下这些bug,并将很快修复它们。

感谢您的好样如何捕捉和复制!

https://jira.spring.io/browse/INT-4448

https://jira.spring.io/browse/INT-4449

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49783344

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档