users@glassfish.java.net

What exactly means NumMsgsHeldInTransaction and NumMsgsPendingAcks in JMS Destinations?

From: Gustavo Henrique Orair <gustavo.orair_at_gmail.com>
Date: Wed, 14 Dec 2011 18:18:45 -0200

Sorry, if it is a very noob question but I have some problems using JMS.

I have some producers that obtain the JMS resources (Connection Factory and
Queue) using explicitly JNDI.

So I create a session using connection.createSession(false,
Session.AUTO_ACKNOWLEDGE).
I assume that as I created the session with first parameter to false, no
transactions are involved and this is really the behaviour I need.

I have an iteration that basically change the object inside ObjectMessage:
                        msg.setObject(objetoCorrente);
And send the message
                        produtorMsg.send(msg);


When monitoring using Jconsole I see the NumMsgs equals to zero while
NumMsgsPendingAcks and NumMsgsHeldInTransaction increases simultaneously.
For some reason, looks like the transacted==false are not being honored and
no msgs are being sent before the session is closed.

Could someone explain me better what exactly NumMsgsPendingAcks and
NumMsgsHeldInTransaction means? And which could be my problem?

Best,
---------------------------------------------------------------------------------------------------------------------
                               Gustavo Henrique Orair
------------------------------------------------------------------------------------------------------------------