【发布时间】:2013-10-14 04:40:32
【问题描述】:
一个模块每 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"/>
【问题讨论】:
-
你能说明一下“这个解决方案不起作用的一些原因”吗?
-
当然 :) 我不断收到 [PollingConsumer] [AbstractTransactionSynchronizingPollingEndpoint.java] [DEBUG] [task-scheduler-1] 在轮询期间未收到任何消息,每 N 秒返回 'false'[PollingConsumer]。