On 7/19/06, Christopher Mihaly <[EMAIL PROTECTED]> wrote:

I have a SOAP service, that when it is called, it creates a connection to the
message broker, and either retrieves messages froma durable topic or
publishes messages to that topic.   The SOAP service can be called pretty
quickly.   I have insured that the threads are synchronized and that it also
reuses active connections with the same clientid.    Howeever, it appears
that I get a already connected error still.  I am pretty sure that the web
service is synchroized, the debug statements appear to indicate that a
connection was established, the message sent, connection closed, and the
subsequent connection was establishe (which could be very quick after the
close) failes with the error.   Is it possible that there is some latency
between the time the connection is closed on the client and the connection
is actually closed on the server such that if a connection request on the
same client id happens too quickly, it wil fail?

Yes, that sounds about right.

The idea behind JMS is that you create a connection up front and then
reuse it over the duration of your application...

http://incubator.apache.org/activemq/how-do-i-use-jms-efficiently.html

so I'd recommend sharing the connection across requests. Note if you
are just sending messages you can use the PooledConnectionFactory to
do this for you if you don't want to change your code to avoid the
create/close of JMS resources each time you have request to make

--

James
-------
http://radio.weblogs.com/0112098/

Reply via email to