Weird behaviour of DeliveringCount
tbuckel Oct 31, 2011 2:14 AMHi all
I'm working on a JMS client application that runs inside Glassfish using the HornetQ resource adapter (HornetQ 2.2.5.Final). It uses XA transactions and uses Spring's JMSTemplate with an explicitly cached Connection, Session and MessageConsumer (see application context fragment below) [I can't use MDBs or Spring's DefaultMessageListenerContainer as multiple messages have to be processed in one transaction.]
The client connects to HornetQ 2.2.5.Final running in a JBoss container.
All transactional behaviour (e.g. rollbacks, resends) works fine, but we have noticed an odd behaviour regarding the DeliveringCount: Everytime a new JMS connection is established, the DeliveringCount on the server in increased by a couple of hundred messages. When the consumer stops, the DeliveringCount remains on its old value.
In the client, I tried setting TransactionBatchSize=0 and ClientWindowSize=0 but that did not change anything. No messages are getting redelivered (I thought that was what DeliveringCount stands for - unacknowledged messages) and no message are pushed to the DLQ.
What does this value of DeliveringCount mean and is it any problem or just an "odd value"?
Thanks
Thomas
Configuration of Spring's JMSTemplate:
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<!-- We want to cache the MessageConsumer for performance -->
<property name="connectionFactory">
<bean class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="databusConnectionFactory" />
<property name="reconnectOnException" value="false" /> <!-- Not allowed in JEE environment -->
</bean>
</property>
<property name="defaultDestinationName" value="${queueName}"/>
<property name="sessionTransacted" value="true"/>
<property name="sessionAcknowledgeModeName" value="SESSION_TRANSACTED"/>
<property name="messageConverter">
<bean class="....." />
</property>
</bean>