activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pkorwar <pkor...@yahoo.com>
Subject Re: Messages stuck in pending state in queue
Date Sat, 13 Jul 2013 23:19:25 GMT
I think I know the problem for the pending messages. I will confirm in 2 days
since I need to more time to test before I can exactly tell that this was
the problem.
Somebody else should test this, and try to reproduce it. 

Here is the scenario.

I have 2 types of jms clients. One client resides in code deployed in war
file on jetty server.
It collects some data from some other data source every 'x' secs. If there
is
a threshold exceeded on some value of a field, it sends a JMS message to the
queue
to raise an alarm. So, since the code is deployed in a war file,
ActiveMQConnectionFactory 
was created once and used later to create connection, session etc.

There is another client of JMS which was called from a script. The script
called a simple
java client which created a JMS message and sent it to a jms queue. Since
this does not
reside on any webserver/appserver, the QueueConnectionFactory was created
every time
the script was invoked. This in my opinion caused the problem since it was
repeatedly
creating the ActiveMQConnectionFactory, a huge object.

Solution: I moved the jms sender code to war file deployed on jetty server.
I implemented
a web service which would send the jms message to the queue. The script
which calls the
java program now became a web service client which send the jms message. So,
since the
code sits on jetty, the ActiveMQConnectionFactory is initialized once and
used over and over 
again to create sessions etc.

I have tested it for over a couple of hours, and have sent more than 100
messages from the
2 clients together, and I have not seen a pending message yet. 

I am hoping that  this was the problem!

Thanks for all your help.

Pramod



--
View this message in context: http://activemq.2283324.n4.nabble.com/Messages-stuck-in-pending-state-in-queue-tp4669239p4669261.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message