users@glassfish.java.net

Re: MDB stops receiving messages

From: Per Steffensen <steff_at_designware.dk>
Date: Wed, 27 May 2009 15:35:16 +0200

Hi

I have tried to find a pattern. I cant find any. Sometimes the MDB stops
receiving messages after a few messages, sometimes it is after several
thousands of messages. If you restart the application server the MDB
will receive message again - for a while.

In my initial setup the MDB was actually doing something meaningfull
with the messages. The messages were sent by JMeter.
But I have been narrowing it down:
- I have changed the MDB.onMessage to do nothing but to log the content
of the message.
- I just send 2000 messages using the Active MQ console. All of the
messages are simple, they just contain the text "test".
- The problem still exists. Some of the "test" messages are received by
the MDB and written to the log. But after a while the MDB stops
receiving messages.

The only log I can find in my Active MQ installation is
<activemq-install>/data/activemq.log. It only contains logs from startup
and closedown of the MQ. Maybe I can see more log information in another
log, or maybe I can change the log level? Anyone? But as it is right now
there is no messages in the activemq.log about my problem.

I have tried to make the following changes:

Resources set up using (change: SupportsXA=false instead of SupportXA=true):
$GLASSFISH_INSTALL/bin/asadmin deploy genericra.rar
$GLASSFISH_INSTALL/bin/adadmin create-resource-adapter-config --property
SupportsXA=false:RMPolicy=OnePerPhysicalConnection:ProviderIntegrationMode=javabean:ConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:QueueConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:TopicConnectionFactoryClassName=org.apache.activemq.ActiveMQConnectionFactory:XAConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:XAQueueConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:XATopicConnectionFactoryClassName=org.apache.activemq.ActiveMQXAConnectionFactory:UnifiedDestinationClassName=org.apache.activemq.command.ActiveMQDestination:QueueClassName=org.apache.activemq.command.ActiveMQQueue:TopicClassName=org.apache.activemq.command.ActiveMQTopic:ConnectionFactoryProperties=brokerURL\\=tcp\\://$ACTIVEMQ_HOST\\:$ACTIVEMQ_PORT:LogLevel=FINE
genericra

MDB looks like this (change: TransactionManagementType.BEAN instead of
TransactionManagementType.CONTAINER):
@TransactionManagement(TransactionManagementType.BEAN)
@MessageDriven(name = "UserHandlerMDB"
// ,activationConfig = { }
)
public class UserHandlerMDB implements MessageListener
{
   public void onMessage(Message arg0) {
       ...
   }
}

Now, without XA, the problem seems to be gone. I have run 5000 "test"
messages through the system, without any problems. That I have never
done using the XA setup.

But I want to use XA, so what do I do???

Regards, Per Steffensen


----- Ramesh wrote ---------

Hi Per,
Is there a pattern to this, i mean does it stop every time after a
certain number of messages are consumed ?
What is the size of the messages ?
Could you turn off XA (SupportsXA=false, and no transaction in MDB
method) and try the same use case, this would help us narrow down the
issue.
Are there any errors/messages in the ActiveMQ log.

Thanks
-Ramesh

>