You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by macdiesel <ma...@speakeasy.net> on 2007/08/19 03:22:43 UTC

How to correctly use AMQ with Tomcat

We seem to have an issue currently with our tomcat container dropping
messages into activemq. 

Here is how it is setup:
-Event happens
-producer is created to drop the message in the queue
-messages is created and dropped into the queue
-producer is closed

The problem seems however is that even after closing the session and the
connection the connection will stay active and not close.  There is also a
60 second timeout set in the activemq config but these sessions never time
out.  Eventually after about 1,000 messages AMQ runs out of file writers and
becomes unresponsive.

So my question is this... What is the correct procedure for doing something
like this?  How are you suppose to close these connections after the message
is sent.

Also we are working with a very low volume here so the overhead of creating
the producer for each message is a non issue.

Thanks,

Mac
-- 
View this message in context: http://www.nabble.com/How-to-correctly-use-AMQ-with-Tomcat-tf4292054s2354.html#a12218527
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


RE: How to correctly use AMQ with Tomcat

Posted by "Suchitha Koneru (sukoneru)" <su...@cisco.com>.
Iam not sure if this would solve the problem . Give it a try . 
After message is dropped into the queue , make the producer null. You
will not be getting a null pointer exception, because the next time, you
would create a new producer to drop the subsequent message. Set the max
Inactivity duration on the broker  to be -1. Are you getting any socket
closed exceptions when the broker is idle for while ?  As you mentioned
that there is a low volume of messages sent via the broker , there is
definitely a possibility for closing down of the tcp sockets used for
communication between the broker and the producer/consumer after a
period of inactivity. Once the sockets get closed , there will not be
any further communication between the broker and the producer/consumer.
The maxInactivity flag when set to -1 will prevent it from happening.
On the broker url  set the flag "wireFormat.maxInactivityDuration=-1"

Hope this helps.

-----Original Message-----
From: macdiesel [mailto:macdiesel@speakeasy.net] 
Sent: Saturday, August 18, 2007 6:23 PM
To: users@activemq.apache.org
Subject: How to correctly use AMQ with Tomcat


We seem to have an issue currently with our tomcat container dropping
messages into activemq. 

Here is how it is setup:
-Event happens
-producer is created to drop the message in the queue -messages is
created and dropped into the queue -producer is closed

The problem seems however is that even after closing the session and the
connection the connection will stay active and not close.  There is also
a 60 second timeout set in the activemq config but these sessions never
time out.  Eventually after about 1,000 messages AMQ runs out of file
writers and becomes unresponsive.

So my question is this... What is the correct procedure for doing
something like this?  How are you suppose to close these connections
after the message is sent.

Also we are working with a very low volume here so the overhead of
creating the producer for each message is a non issue.

Thanks,

Mac
--
View this message in context:
http://www.nabble.com/How-to-correctly-use-AMQ-with-Tomcat-tf4292054s235
4.html#a12218527
Sent from the ActiveMQ - User mailing list archive at Nabble.com.