Spring Integration Gateway没有参数

Joh*_*ley 6 java spring spring-integration

在我的网关上,我有一个方法

@Gateway
String commsTest();
Run Code Online (Sandbox Code Playgroud)

我的想法是,我可以从bean调用commsTest并使用spring集成将其连接到将检查通信的服务激活器.

当我这样做时,我得到一个receive is not supported, because no pollable reply channel has been configured错误.我意识到这是因为没有参数的方法意味着"我正在尝试从频道轮询消息"

这是一个两部分问题.

  1. 从频道轮询消息是什么意思.
  2. 我怎样才能获得我想要的功能.

Gar*_*ell 10

Spring Integration目前没有没有有效负载的消息概念.默认情况下,不带参数的网关方法意味着您希望接收数据(而不是发送数据或发送和接收数据).

您可以更改该默认行为,如参考文档中所述.