You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Ryan Moquin <fr...@gmail.com> on 2009/03/13 16:17:54 UTC

Failover in 5.2.0

I've been using ActivbeMQ 5.2 for a while now and am having a problem where
my topic subscribers seem to lose their connections to the ActiveMQ broker
after around 1,000 messages (it seems like they consistently lose their
connection at just over 1,000 messages).  My publishers (SOA services in
Servicemix) and my consumers (in a separate VM) are on the same machine.  I
can tell my consumers are losing their connections by looking at the
activemq web console, I can see the connections will just go away while my
publishers keep sending.  I don't see any error anywhere on my consumer side
indicating why the connections were dropped.  Now, assuming some weird
network issue (even though they are on the same machine, it seems that
network issues will affect local connections) is causing my client to drop,
I thought that ActiveMQ 5.2.0 used failover by default when you use a URL
such as:

tcp://localhost:61616

Since according to the release page it says:

"The default ActiveMQConnectionFactory<http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQConnectionFactory.html>brokerUrl
now uses the failover
transport <http://activemq.apache.org/failover-transport-reference.html>."

Am I mistaken on that?  Or do I still need to use the failover URL?  Is it
common for a consumer to lose a connection like this and using a failover
URL is all I need to put back in?  I never saw this problem when using
earlier versions of ActiveMQ with failover.  Since I moved to 5.2, I removed
the failover part of the URL because I thought 5.2 used it by default.  Any
clarification on this would be helpful, or even a suggestion on how to
troubleshoot the issue.  It seems like the only way I might be able to get
some log output to help with the problem is by turning on debug mode?

Thanks for any help!

Ryan

Re: Failover in 5.2.0

Posted by Gary Tully <ga...@gmail.com>.
The Failover transport layers reconnect logic on top of any of the other
transports.
On NIO, that is typically a broker side option, so the broker will use tcp
using NIO on its transportConnector or listener. A client will still use the
the regular tcp stack.

2009/3/13 Ryan Moquin <fr...@gmail.com>

> That would be fine.. I just want to reestablish the connection if it gets
> dropped (it seems like there are constant network hiccups that cause my
> connection to get lost).  I don't want to lose the connection from
> innactivity either though.  Will it still block if I use the NIO transport?
> Or can I not wrap the NIO transport with the failover transport?
>
> Thanks for your help.
>
> Ryan
>
> On Fri, Mar 13, 2009 at 1:07 PM, Gary Tully <ga...@gmail.com> wrote:
>
> > If you are in the same VM, then use the
> > vm:<http://activemq.apache.org/how-should-i-use-the-vm-transport.html
> > >scheme
> > as this will be a lot faster as there is no marshaling overhead.
> >
> > I guess it is worth investigating what is causing your connections to get
> > dropped. Is it inactivity timeout or network issues?
> >
> > With failover, network or connection drop issues will be hidden from your
> > application as the transport will block while it reconnects.
> > There may be situations where you want such issues to filter up to your
> > application to deal with them there, in which case failover: should be
> > avoided or configured to fail after a low number of retries.
> >
> > but it is no harm to use it with a single broker, just be aware that by
> > default it will block with some incremental backoff. check out the
> > reference
> > page for details.
> >
> > 2009/3/13 Ryan Moquin <fr...@gmail.com>
> >
> > > Ahhhhhh ok.. that explains a lot... Too bad I didn't ask this question
> a
> > > lot
> > > sooner since I've been very confused over the last week on why updates
> > > seemed to stop unexpectedly when they never used to.  On the same note,
> > > should I use failover even for interVM connections?  Such as my
> > servicemix
> > > services?  Are there any times it's safe not to use the failover
> > transport?
> > > Or should it always be used unless you have a specific reason you
> > wouldn't
> > > want it to connect?
> > >
> > > Thanks!
> > >
> > > On Fri, Mar 13, 2009 at 12:16 PM, Gary Tully <ga...@gmail.com>
> > wrote:
> > >
> > > > you still need to use the failover: scheme in 5.2 when you provide a
> > url
> > > > and
> > > > want failover.
> > > > The change only effects users who do not provide a brokerUrl to the
> > > > ActiveMQConnectionFactory.
> > > > That is the only case where the defaultUrl is used.
> > > >
> > > > 2009/3/13 Ryan Moquin <fr...@gmail.com>
> > > >
> > > > > I've been using ActivbeMQ 5.2 for a while now and am having a
> problem
> > > > where
> > > > > my topic subscribers seem to lose their connections to the ActiveMQ
> > > > broker
> > > > > after around 1,000 messages (it seems like they consistently lose
> > their
> > > > > connection at just over 1,000 messages).  My publishers (SOA
> services
> > > in
> > > > > Servicemix) and my consumers (in a separate VM) are on the same
> > > machine.
> > > >  I
> > > > > can tell my consumers are losing their connections by looking at
> the
> > > > > activemq web console, I can see the connections will just go away
> > while
> > > > my
> > > > > publishers keep sending.  I don't see any error anywhere on my
> > consumer
> > > > > side
> > > > > indicating why the connections were dropped.  Now, assuming some
> > weird
> > > > > network issue (even though they are on the same machine, it seems
> > that
> > > > > network issues will affect local connections) is causing my client
> to
> > > > drop,
> > > > > I thought that ActiveMQ 5.2.0 used failover by default when you use
> a
> > > URL
> > > > > such as:
> > > > >
> > > > > tcp://localhost:61616
> > > > >
> > > > > Since according to the release page it says:
> > > > >
> > > > > "The default ActiveMQConnectionFactory<
> > > > >
> > > >
> > >
> >
> http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQConnectionFactory.html
> > > > > >brokerUrl
> > > > > now uses the failover
> > > > > transport <
> > > http://activemq.apache.org/failover-transport-reference.html
> > > > >."
> > > > >
> > > > > Am I mistaken on that?  Or do I still need to use the failover URL?
> >  Is
> > > > it
> > > > > common for a consumer to lose a connection like this and using a
> > > failover
> > > > > URL is all I need to put back in?  I never saw this problem when
> > using
> > > > > earlier versions of ActiveMQ with failover.  Since I moved to 5.2,
> I
> > > > > removed
> > > > > the failover part of the URL because I thought 5.2 used it by
> > default.
> > > >  Any
> > > > > clarification on this would be helpful, or even a suggestion on how
> > to
> > > > > troubleshoot the issue.  It seems like the only way I might be able
> > to
> > > > get
> > > > > some log output to help with the problem is by turning on debug
> mode?
> > > > >
> > > > > Thanks for any help!
> > > > >
> > > > > Ryan
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > http://blog.garytully.com
> > > >
> > > > Open Source SOA
> > > > http://FUSESource.com
> > > >
> > >
> >
> >
> >
> > --
> > http://blog.garytully.com
> >
> > Open Source SOA
> > http://FUSESource.com
> >
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Re: Failover in 5.2.0

Posted by Ryan Moquin <fr...@gmail.com>.
That would be fine.. I just want to reestablish the connection if it gets
dropped (it seems like there are constant network hiccups that cause my
connection to get lost).  I don't want to lose the connection from
innactivity either though.  Will it still block if I use the NIO transport?
Or can I not wrap the NIO transport with the failover transport?

Thanks for your help.

Ryan

On Fri, Mar 13, 2009 at 1:07 PM, Gary Tully <ga...@gmail.com> wrote:

> If you are in the same VM, then use the
> vm:<http://activemq.apache.org/how-should-i-use-the-vm-transport.html
> >scheme
> as this will be a lot faster as there is no marshaling overhead.
>
> I guess it is worth investigating what is causing your connections to get
> dropped. Is it inactivity timeout or network issues?
>
> With failover, network or connection drop issues will be hidden from your
> application as the transport will block while it reconnects.
> There may be situations where you want such issues to filter up to your
> application to deal with them there, in which case failover: should be
> avoided or configured to fail after a low number of retries.
>
> but it is no harm to use it with a single broker, just be aware that by
> default it will block with some incremental backoff. check out the
> reference
> page for details.
>
> 2009/3/13 Ryan Moquin <fr...@gmail.com>
>
> > Ahhhhhh ok.. that explains a lot... Too bad I didn't ask this question a
> > lot
> > sooner since I've been very confused over the last week on why updates
> > seemed to stop unexpectedly when they never used to.  On the same note,
> > should I use failover even for interVM connections?  Such as my
> servicemix
> > services?  Are there any times it's safe not to use the failover
> transport?
> > Or should it always be used unless you have a specific reason you
> wouldn't
> > want it to connect?
> >
> > Thanks!
> >
> > On Fri, Mar 13, 2009 at 12:16 PM, Gary Tully <ga...@gmail.com>
> wrote:
> >
> > > you still need to use the failover: scheme in 5.2 when you provide a
> url
> > > and
> > > want failover.
> > > The change only effects users who do not provide a brokerUrl to the
> > > ActiveMQConnectionFactory.
> > > That is the only case where the defaultUrl is used.
> > >
> > > 2009/3/13 Ryan Moquin <fr...@gmail.com>
> > >
> > > > I've been using ActivbeMQ 5.2 for a while now and am having a problem
> > > where
> > > > my topic subscribers seem to lose their connections to the ActiveMQ
> > > broker
> > > > after around 1,000 messages (it seems like they consistently lose
> their
> > > > connection at just over 1,000 messages).  My publishers (SOA services
> > in
> > > > Servicemix) and my consumers (in a separate VM) are on the same
> > machine.
> > >  I
> > > > can tell my consumers are losing their connections by looking at the
> > > > activemq web console, I can see the connections will just go away
> while
> > > my
> > > > publishers keep sending.  I don't see any error anywhere on my
> consumer
> > > > side
> > > > indicating why the connections were dropped.  Now, assuming some
> weird
> > > > network issue (even though they are on the same machine, it seems
> that
> > > > network issues will affect local connections) is causing my client to
> > > drop,
> > > > I thought that ActiveMQ 5.2.0 used failover by default when you use a
> > URL
> > > > such as:
> > > >
> > > > tcp://localhost:61616
> > > >
> > > > Since according to the release page it says:
> > > >
> > > > "The default ActiveMQConnectionFactory<
> > > >
> > >
> >
> http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQConnectionFactory.html
> > > > >brokerUrl
> > > > now uses the failover
> > > > transport <
> > http://activemq.apache.org/failover-transport-reference.html
> > > >."
> > > >
> > > > Am I mistaken on that?  Or do I still need to use the failover URL?
>  Is
> > > it
> > > > common for a consumer to lose a connection like this and using a
> > failover
> > > > URL is all I need to put back in?  I never saw this problem when
> using
> > > > earlier versions of ActiveMQ with failover.  Since I moved to 5.2, I
> > > > removed
> > > > the failover part of the URL because I thought 5.2 used it by
> default.
> > >  Any
> > > > clarification on this would be helpful, or even a suggestion on how
> to
> > > > troubleshoot the issue.  It seems like the only way I might be able
> to
> > > get
> > > > some log output to help with the problem is by turning on debug mode?
> > > >
> > > > Thanks for any help!
> > > >
> > > > Ryan
> > > >
> > >
> > >
> > >
> > > --
> > > http://blog.garytully.com
> > >
> > > Open Source SOA
> > > http://FUSESource.com
> > >
> >
>
>
>
> --
> http://blog.garytully.com
>
> Open Source SOA
> http://FUSESource.com
>

Re: Failover in 5.2.0

Posted by Gary Tully <ga...@gmail.com>.
If you are in the same VM, then use the
vm:<http://activemq.apache.org/how-should-i-use-the-vm-transport.html>scheme
as this will be a lot faster as there is no marshaling overhead.

I guess it is worth investigating what is causing your connections to get
dropped. Is it inactivity timeout or network issues?

With failover, network or connection drop issues will be hidden from your
application as the transport will block while it reconnects.
There may be situations where you want such issues to filter up to your
application to deal with them there, in which case failover: should be
avoided or configured to fail after a low number of retries.

but it is no harm to use it with a single broker, just be aware that by
default it will block with some incremental backoff. check out the reference
page for details.

2009/3/13 Ryan Moquin <fr...@gmail.com>

> Ahhhhhh ok.. that explains a lot... Too bad I didn't ask this question a
> lot
> sooner since I've been very confused over the last week on why updates
> seemed to stop unexpectedly when they never used to.  On the same note,
> should I use failover even for interVM connections?  Such as my servicemix
> services?  Are there any times it's safe not to use the failover transport?
> Or should it always be used unless you have a specific reason you wouldn't
> want it to connect?
>
> Thanks!
>
> On Fri, Mar 13, 2009 at 12:16 PM, Gary Tully <ga...@gmail.com> wrote:
>
> > you still need to use the failover: scheme in 5.2 when you provide a url
> > and
> > want failover.
> > The change only effects users who do not provide a brokerUrl to the
> > ActiveMQConnectionFactory.
> > That is the only case where the defaultUrl is used.
> >
> > 2009/3/13 Ryan Moquin <fr...@gmail.com>
> >
> > > I've been using ActivbeMQ 5.2 for a while now and am having a problem
> > where
> > > my topic subscribers seem to lose their connections to the ActiveMQ
> > broker
> > > after around 1,000 messages (it seems like they consistently lose their
> > > connection at just over 1,000 messages).  My publishers (SOA services
> in
> > > Servicemix) and my consumers (in a separate VM) are on the same
> machine.
> >  I
> > > can tell my consumers are losing their connections by looking at the
> > > activemq web console, I can see the connections will just go away while
> > my
> > > publishers keep sending.  I don't see any error anywhere on my consumer
> > > side
> > > indicating why the connections were dropped.  Now, assuming some weird
> > > network issue (even though they are on the same machine, it seems that
> > > network issues will affect local connections) is causing my client to
> > drop,
> > > I thought that ActiveMQ 5.2.0 used failover by default when you use a
> URL
> > > such as:
> > >
> > > tcp://localhost:61616
> > >
> > > Since according to the release page it says:
> > >
> > > "The default ActiveMQConnectionFactory<
> > >
> >
> http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQConnectionFactory.html
> > > >brokerUrl
> > > now uses the failover
> > > transport <
> http://activemq.apache.org/failover-transport-reference.html
> > >."
> > >
> > > Am I mistaken on that?  Or do I still need to use the failover URL?  Is
> > it
> > > common for a consumer to lose a connection like this and using a
> failover
> > > URL is all I need to put back in?  I never saw this problem when using
> > > earlier versions of ActiveMQ with failover.  Since I moved to 5.2, I
> > > removed
> > > the failover part of the URL because I thought 5.2 used it by default.
> >  Any
> > > clarification on this would be helpful, or even a suggestion on how to
> > > troubleshoot the issue.  It seems like the only way I might be able to
> > get
> > > some log output to help with the problem is by turning on debug mode?
> > >
> > > Thanks for any help!
> > >
> > > Ryan
> > >
> >
> >
> >
> > --
> > http://blog.garytully.com
> >
> > Open Source SOA
> > http://FUSESource.com
> >
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Re: Failover in 5.2.0

Posted by Ryan Moquin <fr...@gmail.com>.
Ahhhhhh ok.. that explains a lot... Too bad I didn't ask this question a lot
sooner since I've been very confused over the last week on why updates
seemed to stop unexpectedly when they never used to.  On the same note,
should I use failover even for interVM connections?  Such as my servicemix
services?  Are there any times it's safe not to use the failover transport?
Or should it always be used unless you have a specific reason you wouldn't
want it to connect?

Thanks!

On Fri, Mar 13, 2009 at 12:16 PM, Gary Tully <ga...@gmail.com> wrote:

> you still need to use the failover: scheme in 5.2 when you provide a url
> and
> want failover.
> The change only effects users who do not provide a brokerUrl to the
> ActiveMQConnectionFactory.
> That is the only case where the defaultUrl is used.
>
> 2009/3/13 Ryan Moquin <fr...@gmail.com>
>
> > I've been using ActivbeMQ 5.2 for a while now and am having a problem
> where
> > my topic subscribers seem to lose their connections to the ActiveMQ
> broker
> > after around 1,000 messages (it seems like they consistently lose their
> > connection at just over 1,000 messages).  My publishers (SOA services in
> > Servicemix) and my consumers (in a separate VM) are on the same machine.
>  I
> > can tell my consumers are losing their connections by looking at the
> > activemq web console, I can see the connections will just go away while
> my
> > publishers keep sending.  I don't see any error anywhere on my consumer
> > side
> > indicating why the connections were dropped.  Now, assuming some weird
> > network issue (even though they are on the same machine, it seems that
> > network issues will affect local connections) is causing my client to
> drop,
> > I thought that ActiveMQ 5.2.0 used failover by default when you use a URL
> > such as:
> >
> > tcp://localhost:61616
> >
> > Since according to the release page it says:
> >
> > "The default ActiveMQConnectionFactory<
> >
> http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQConnectionFactory.html
> > >brokerUrl
> > now uses the failover
> > transport <http://activemq.apache.org/failover-transport-reference.html
> >."
> >
> > Am I mistaken on that?  Or do I still need to use the failover URL?  Is
> it
> > common for a consumer to lose a connection like this and using a failover
> > URL is all I need to put back in?  I never saw this problem when using
> > earlier versions of ActiveMQ with failover.  Since I moved to 5.2, I
> > removed
> > the failover part of the URL because I thought 5.2 used it by default.
>  Any
> > clarification on this would be helpful, or even a suggestion on how to
> > troubleshoot the issue.  It seems like the only way I might be able to
> get
> > some log output to help with the problem is by turning on debug mode?
> >
> > Thanks for any help!
> >
> > Ryan
> >
>
>
>
> --
> http://blog.garytully.com
>
> Open Source SOA
> http://FUSESource.com
>

Re: Failover in 5.2.0

Posted by Gary Tully <ga...@gmail.com>.
you still need to use the failover: scheme in 5.2 when you provide a url and
want failover.
The change only effects users who do not provide a brokerUrl to the
ActiveMQConnectionFactory.
That is the only case where the defaultUrl is used.

2009/3/13 Ryan Moquin <fr...@gmail.com>

> I've been using ActivbeMQ 5.2 for a while now and am having a problem where
> my topic subscribers seem to lose their connections to the ActiveMQ broker
> after around 1,000 messages (it seems like they consistently lose their
> connection at just over 1,000 messages).  My publishers (SOA services in
> Servicemix) and my consumers (in a separate VM) are on the same machine.  I
> can tell my consumers are losing their connections by looking at the
> activemq web console, I can see the connections will just go away while my
> publishers keep sending.  I don't see any error anywhere on my consumer
> side
> indicating why the connections were dropped.  Now, assuming some weird
> network issue (even though they are on the same machine, it seems that
> network issues will affect local connections) is causing my client to drop,
> I thought that ActiveMQ 5.2.0 used failover by default when you use a URL
> such as:
>
> tcp://localhost:61616
>
> Since according to the release page it says:
>
> "The default ActiveMQConnectionFactory<
> http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQConnectionFactory.html
> >brokerUrl
> now uses the failover
> transport <http://activemq.apache.org/failover-transport-reference.html>."
>
> Am I mistaken on that?  Or do I still need to use the failover URL?  Is it
> common for a consumer to lose a connection like this and using a failover
> URL is all I need to put back in?  I never saw this problem when using
> earlier versions of ActiveMQ with failover.  Since I moved to 5.2, I
> removed
> the failover part of the URL because I thought 5.2 used it by default.  Any
> clarification on this would be helpful, or even a suggestion on how to
> troubleshoot the issue.  It seems like the only way I might be able to get
> some log output to help with the problem is by turning on debug mode?
>
> Thanks for any help!
>
> Ryan
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com