我刚刚开始使用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应用程序的端口访问它。
如果有人能帮我找出原因,那就太好了。
谢谢,
发布于 2018-04-12 04:38:19
网关方法没有任何参数的问题:
@Gateway(requestChannel = "get.request.channel", replyChannel = "reply.channel")
String getCustomMessage();在这种情况下,网关作为接收工作。不发送任何请求,因为没有要包装到payload的内容。请在Reference Manual中查看有关此问题的更多信息。
现在,我发现payloadExpression有几个bug,但没有arg,所以我建议您在getCustomMessage()网关方法中添加一些String payload arg,并使用空字符串执行它。
将研究一下这些bug,并将很快修复它们。
感谢您的好样如何捕捉和复制!
https://stackoverflow.com/questions/49783344
复制相似问题