activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Mihaly <>
Subject Re: Client already connected problem
Date Thu, 20 Jul 2006 17:58:28 GMT

 Ok, I agree I may not be using it the best way.   But, it doesn't seem
correct to me that I can close a connection and then open a connection with
the same name and have it fail.   If I close a connection, and the function
returns successfully, I would think I should be able to turn around and open
the connection again and have it succeed (assuming no other process comes in
trying to open the connection with that ID, which it cannot in this
scenario).  Why would this not be considered a bug?


James.Strachan wrote:
> On 7/19/06, Christopher Mihaly <> 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...
> 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
> -------
View this message in context:
Sent from the ActiveMQ - User forum at

View raw message