jeudi 19 mars 2015

Spring JMS listener receives empty messages causing CPU consumption

I'm working on an application that uses a couple of jms queues to send/receive updates to/from an external system. In order to test my application I'm using Mockrunner and specifically the jms module. I'm facing a strange behavior: when I start my application I can see the CPU skyrocketing at 100% and, by analyzing thread dumps, I can see that the main reason is related to the jms listeners I have that looks like receiving empty messages this causing messages like:



Consumer ... did not receive a message


Now I'm trying to understand if the issue is related to a bad interaction of my app and mockrunner or is a configuration error.


The relevant parts of the configuration are:



<bean id="destinationManager" factory-bean="mockRunnerJMSObjectFactory" factory-method="getDestinationManager" />

<bean id="mockJmsConnectionFactory" factory-bean="mockRunnerJMSObjectFactory" factory-method="createMockConnectionFactory" lazy-init="true"/>


and the listener that cause the CPU to spin indefinitely are:



<jms:listener-container concurrency="5" connection-factory="mockJmsConnectionFactory" destination-type="queue" message-converter="myMessageConverter" acknowledge="transacted" >
<jms:listener
id="myListener"
destination="myQueue"
ref="myConsumer"
method="consume"
/>
</jms:listener-container>

<bean id="myConsumer"... />


UPDATE I opened an issue on Mockrunner project, you can see it here.


Aucun commentaire:

Enregistrer un commentaire