activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Mihaly <cmih...@hotmail.com>
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?

   Thanks
      Chris


James.Strachan wrote:
> 
> On 7/19/06, Christopher Mihaly <cmihaly@hotmail.com> 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/
> 
> 
-- 
View this message in context: http://www.nabble.com/Client-already-connected-problem-tf1963708.html#a5420724
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message