Java process with Spring Message Driven POJOs required a restart after a while to consume messages from MQ

443 Views Asked by At

I have a Java (1.7) process which uses Spring MDPs (Spring 4.2.3 JMS framework) to read and process Messages from Websphere MQ 8.1 queues which worked well in production without issues for several weeks ; but recently stopped consuming messages from the queue until it was restarted (Java process was up & running and there were no exceptions/errors in the logs). The messages were simply expiring from the queue after a timeout when I faced the problem. The fact that I had to restart the process indicates a problem somewhere.. since I'm only using Spring framework feature I have no clues on what I can do to troubleshoot/narrow down the problem in case if this happens again. Appreciate any suggestions to put some diagnostic measures in place..

I noticed that the the java process had to do multiple rollback of messages back to the queue due to a network timeout issue while processing them on the day I faced the problem

I have attached the Spring MDP configuration below

<!-- WebSphere MQ Connection Factory -->
<bean id="mqConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
    <property name="hostName">
        <value>${mq.wal.queue_hostname}</value>
    </property>
    <property name="port">
        <value>${mq.wal.queue_port}</value>
    </property>
    <property name="queueManager">
        <value>${mq.wal.queue_manager}</value>
    </property>
    <property name="transportType">
        <!-- BINDING MODE -->
        <value>${mq.wal.transport_type}</value>
    </property>
</bean>

<!-- JMS Queue Connection Factory -->
<bean id="jmsQueueConnectionFactory"
    class="org.springframework.jms.connection.CachingConnectionFactory">
    <property name="targetConnectionFactory">
        <ref bean="mqConnectionFactory" />
    </property>
</bean>

<!-- IN queue -->
<bean id="in_queue" class="com.ibm.mq.jms.MQQueue"
    depends-on="jmsQueueConnectionFactory">
    <property name="baseQueueManagerName" value="${mq.queue_manager}" />
    <property name="baseQueueName" value="${mq.inqueue}" />
</bean>

<!--  Error handler -->
<bean id="messageErrorHandler" class="coop.mm.wallet.access.service.MessagingErrorHandler"></bean>
<!-- End error handler -->

<!-- Listener containers for INBOUND Queues -->
<!-- listener container -->
<bean id="listener_container"
    class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="jmsQueueConnectionFactory" />
    <property name="destination" ref="in_queue" />
    <property name="messageListener" ref="messageListener" />
    <property name="sessionTransacted" value="true" />
    <property name="concurrency" value="${listener_count}" />
    <property name="errorHandler" ref="messageErrorHandler"/>
</bean>
0

There are 0 best solutions below