一个模块每 N 秒向消息代理发送消息。另一个模块从代理接收消息。消息构建在服务激活器的方法 sendMessage 中。计划是使用入站通道适配器(如答案中所示),但由于某些原因,此解决方案不起作用,我一直收到“在轮询期间未收到任何消息,返回 'false'”。这个配置有什么问题?
<int-jms:inbound-channel-adapter id="keepAlivePoller" channel="keepAliveChannel" destination="keepAlive" connection-factory="connectionFactory">
<si:poller id="sendPoller" fixed-rate="${keepalive.sendinterval}" max-messages-per-poll="1"></si:poller>
</int-jms:inbound-channel-adapter>
<si:service-activator input-channel="keepAliveChannel" method="sendMessage" ref="keepAliveSender"/>
<bean class="com.foo.KeepAliveSender"/>
<si:channel id="keepAliveChannel"/>