You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by dlaube <dl...@gmail.com> on 2013/10/12 03:17:20 UTC

Cannot consume messages on queue after master/slave failover in ActiveMQ 5.8.0.

I am encountering some issues with master/slave failover with ActiveMQ 5.8.0
running on RHEL and would appreciate some recommendations/help from the
community if possible. I have tried searching but nothing seems to resolve
my issue. Using the ActiveMQ example apps (per
http://activemq.apache.org/examples.html) I setup the consumer and producer
using the failover transport and then walked through a failure on master.
Steps to reproduce, along with the commands are included below.

The consumer starts eating the messages that the producer sends to my
TEST.FOO queue. Next, when I kill the ActiveMQ master broker, I see that the
the producer reconnects to the slave/new-master and will continue sending
messages where it left off. However, the consumer re-connects but then fails
to receive any messages from the slave/new-master after failover. I see that
the TEST.FOO queue was (re)created on the slave/new-master after the
failover takes place. The consumer reports the following;  [java] 00:00:35
WARN  Transport (tcp://master_IP:61616) failed, reason: 
java.net.SocketException: Connection reset, attempting to automatically
reconnect    [java] 00:00:39 INFO  Successfully reconnected to
tcp://slave:61616


Steps to reproduce:
1. Start ActiveMQ broker master  and slave
2. Start ActiveMQ producer and consumer ( parenthesis and ampersands are
escaped for good measure, otherwise BASH complains as expected )
ant producer
-Durl=failover://\(tcp://master:61616,tcp://slave:61616\)?randomize=false\&timeout=3000
-Dtopic=false -DtimeToLive=30000 -Ddurable=false -Dmax=80000
ant consumer
-Durl=failover://\(tcp://master:61616,tcp://slave:61616\)?randomize=false\&timeout=3000
-Dtopic=false -Ddurable=false -Dmax=80000
3. Kill ActiveMQ master and observe ActiveMQ slave takeover. Look for string
"Becoming the master on dataSource:
org.apache.commons.dbcp.BasicDataSource@2482c23d" in ActiveMQ logs located
on the slave.
4. Observe timeout/reconnect operations in both the consumer and producer
that was started in step #2. The producer will reconnect 


Has anyone encountered this issue before with a two-node master/slave
implementation of ActiveMQ? If so, what was the resolution?


Best regards,
-David Laube



--
View this message in context: http://activemq.2283324.n4.nabble.com/Cannot-consume-messages-on-queue-after-master-slave-failover-in-ActiveMQ-5-8-0-tp4672708.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Cannot consume messages on queue after master/slave failover in ActiveMQ 5.8.0.

Posted by Matt Pavlovich <ma...@gmail.com>.
David-

Try setting -Ddurable=true. It looks like you are producing non-persistent messages.  Non-persistent messages would be lost when the master goes down.

Hope this helps.
-Matt

On Oct 11, 2013, at 8:17 PM, dlaube <dl...@gmail.com> wrote:

> I am encountering some issues with master/slave failover with ActiveMQ 5.8.0
> running on RHEL and would appreciate some recommendations/help from the
> community if possible. I have tried searching but nothing seems to resolve
> my issue. Using the ActiveMQ example apps (per
> http://activemq.apache.org/examples.html) I setup the consumer and producer
> using the failover transport and then walked through a failure on master.
> Steps to reproduce, along with the commands are included below.
> 
> The consumer starts eating the messages that the producer sends to my
> TEST.FOO queue. Next, when I kill the ActiveMQ master broker, I see that the
> the producer reconnects to the slave/new-master and will continue sending
> messages where it left off. However, the consumer re-connects but then fails
> to receive any messages from the slave/new-master after failover. I see that
> the TEST.FOO queue was (re)created on the slave/new-master after the
> failover takes place. The consumer reports the following;  [java] 00:00:35
> WARN  Transport (tcp://master_IP:61616) failed, reason: 
> java.net.SocketException: Connection reset, attempting to automatically
> reconnect    [java] 00:00:39 INFO  Successfully reconnected to
> tcp://slave:61616
> 
> 
> Steps to reproduce:
> 1. Start ActiveMQ broker master  and slave
> 2. Start ActiveMQ producer and consumer ( parenthesis and ampersands are
> escaped for good measure, otherwise BASH complains as expected )
> ant producer
> -Durl=failover://\(tcp://master:61616,tcp://slave:61616\)?randomize=false\&timeout=3000
> -Dtopic=false -DtimeToLive=30000 -Ddurable=false -Dmax=80000
> ant consumer
> -Durl=failover://\(tcp://master:61616,tcp://slave:61616\)?randomize=false\&timeout=3000
> -Dtopic=false -Ddurable=false -Dmax=80000
> 3. Kill ActiveMQ master and observe ActiveMQ slave takeover. Look for string
> "Becoming the master on dataSource:
> org.apache.commons.dbcp.BasicDataSource@2482c23d" in ActiveMQ logs located
> on the slave.
> 4. Observe timeout/reconnect operations in both the consumer and producer
> that was started in step #2. The producer will reconnect 
> 
> 
> Has anyone encountered this issue before with a two-node master/slave
> implementation of ActiveMQ? If so, what was the resolution?
> 
> 
> Best regards,
> -David Laube
> 
> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Cannot-consume-messages-on-queue-after-master-slave-failover-in-ActiveMQ-5-8-0-tp4672708.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.