You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Saurabh Chandra <ch...@gmail.com> on 2006/07/19 13:37:19 UTC
How to reconnect gracefully?
Hi,
I have an embedded activemq broker inside tomcat and a consumer
running on another tomcat server. I am able to start the broker, post
messages to a topic from a producer inside the broker tomcat itself,
which are recieved by a consumer listening on the consumer tomcat.
Using activemq 4.0 with spring.
I want to configure a graceful restart of the client tomcat, so thatI
can restart the consumer tomcat and have it again listen to the topic
The scenario gives me an exception that the client-id already exists
(when the consumer wants to reconnect) and I have to restart the
broker and delete the journal for it to be able to reconnect. I
suspect that the client-id is registered with the broker and the new
client has to somehow resume connection instead of starting again. Can
someone point me to an exact solution?
thanks much
Saurabh
Re: How to reconnect gracefully?
Posted by Saurabh Chandra <ch...@gmail.com>.
Hi,
I found a clue to the solution in another response on the forum which led me to
http://incubator.apache.org/activemq/how-can-i-support-auto-reconnection.html
I changed the connection uri to use failover and now reconnects happen
smoothly for a client restarting as well as a broker restarting or
being killed.
Will report the issue with test code in case it surfaces again.
thanks
Saurabh
On 7/19/06, Hiram Chirino <hi...@hiramchirino.com> wrote:
> think that junit test could be created to simulate this?
>
> On 7/19/06, Saurabh Chandra <ch...@gmail.com> wrote:
> >
> > Hi,
> >
> > I have an embedded activemq broker inside tomcat and a consumer
> > running on another tomcat server. I am able to start the broker, post
> > messages to a topic from a producer inside the broker tomcat itself,
> > which are recieved by a consumer listening on the consumer tomcat.
> > Using activemq 4.0 with spring.
> >
> > I want to configure a graceful restart of the client tomcat, so thatI
> > can restart the consumer tomcat and have it again listen to the topic
> >
> > The scenario gives me an exception that the client-id already exists
> > (when the consumer wants to reconnect) and I have to restart the
> > broker and delete the journal for it to be able to reconnect. I
> > suspect that the client-id is registered with the broker and the new
> > client has to somehow resume connection instead of starting again. Can
> > someone point me to an exact solution?
> >
> > thanks much
> > Saurabh
> >
>
>
>
> --
> Regards,
> Hiram
>
> Blog: http://hiramchirino.com
>
>
Re: How to reconnect gracefully?
Posted by Hiram Chirino <hi...@hiramchirino.com>.
think that junit test could be created to simulate this?
On 7/19/06, Saurabh Chandra <ch...@gmail.com> wrote:
>
> Hi,
>
> I have an embedded activemq broker inside tomcat and a consumer
> running on another tomcat server. I am able to start the broker, post
> messages to a topic from a producer inside the broker tomcat itself,
> which are recieved by a consumer listening on the consumer tomcat.
> Using activemq 4.0 with spring.
>
> I want to configure a graceful restart of the client tomcat, so thatI
> can restart the consumer tomcat and have it again listen to the topic
>
> The scenario gives me an exception that the client-id already exists
> (when the consumer wants to reconnect) and I have to restart the
> broker and delete the journal for it to be able to reconnect. I
> suspect that the client-id is registered with the broker and the new
> client has to somehow resume connection instead of starting again. Can
> someone point me to an exact solution?
>
> thanks much
> Saurabh
>
--
Regards,
Hiram
Blog: http://hiramchirino.com