0
votes

One module sends messages to the message broker every N second. The other module receive the messages from the broker. The messages is built in a method sendMessage of the service activator. The plan was to use inbound channel adapter (as in the answer) but for some reasons this solution does not work and I keep receiving "Received no Message during the poll, returning 'false'". What is wrong with this configuration?

<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"/>
1
Can you show those ' some reasons this solution does not work' ?Artem Bilan
Sure :) I keep getting [PollingConsumer] [AbstractTransactionSynchronizingPollingEndpoint.java] [DEBUG] [task-scheduler-1] Received no Message during the poll, returning 'false'[PollingConsumer] every N sec.luksmir

1 Answers

0
votes

That will only send a message if there is a message in the "keepAlive" queue.

You can simply use...

<int:inbound-channel-adapter id="keepAlivePoller" channel="keepAliveChannel"
        expression="'foo'"> 
    <si:poller id="sendPoller"  fixed-rate="${keepalive.sendinterval}" />
</int:inbound-channel-adapter>

... and not use JMS at all.