I am using Spring 3.0 - DefaultMessageListenerContainer to connect to WebSphere 6 MQ. MQ already has messages. When I run my test, the listener that implements the SessionAwareMessageListener starts. But onMessage () does not call. Thus, the problem is that messages already in the queue are not read.
According to docs, autoStartup is true by default (and I haven't changed it). In accordance with my underutilization, at startup, the listener should read the queue for any existing messages, and the onMessage () function should be called. Please let me know if this understanding is incorrect.
Here is a snippet from the configuration file:
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="connectionFactory" ref="jmsQueueConnectionFactory" /> <property name="destinationName"> <value>${queue}</value> </property> <property name="messageListener" ref="exampleMessageListener" /> <property name="concurrentConsumers" value="1" /> <property name="maxConcurrentConsumers" value="1" /> <property name="idleTaskExecutionLimit" value="4" /> <property name="maxMessagesPerTask" value="4" /> <property name="receiveTimeout" value="5000" /> <property name="recoveryInterval" value="5000" /> <property name="sessionTransacted" value="true" /> <property name="transactionManager" ref="jmsTransActionManager" /> </bean>
Note: there is no error / exception, the test application starts just fine.
Any pointers to solve this problem will be helpful.
Thanks,
Rj
source share