You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Vijay <vi...@gmail.com> on 2011/06/28 14:40:08 UTC

Master/Slave configuring clients

We are implementing AMQ's master/slave broker topology to achieve geographic
redundancy. 

Master is hosted on Server A and Slave is hosted on Server B. 

For geographic redundancy, we will have two consumer apps which will be
hosted on the same servers. These consumers will consume a Q named
"TEST.FOO" (an upstream system will produce the messages onto thsi Q using
master/slave failover URL). So the idea is if Server A dies, Server B
(slave) and its consumer should take over.

here is the setup in summary:

ServerA
----------
Master (tcp://master:61616)
Consumer A

ServerB
----------
Slave (tcp://master:61617)
Consumer B

1. What URL should I use to configure both the consumers?

2. Can I make use of VM protocol in my case, considering broker and consumer
running on the same server to avoid tcp traffic? If yes, How does the URL
look like>






--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-configuring-clients-tp3630225p3630225.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave configuring clients

Posted by Vijay <vi...@gmail.com>.
Unfortunately I see the same behavior in linux as well. Any thoughts?


Vijay wrote:
> 
> Yes. I am using WinXP. Will try to run in linux and verify. Post the
> results back here. Thanks.
> 
> 
> boday wrote:
>> 
>> are you using Windows?  If so, you might see this bug 
>> https://issues.apache.org/jira/browse/AMQ-3273 AMQ-3273 ...it caused me a
>> lot of confusion while trying to test this scenario.
>> 
> 


--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-configuring-clients-tp3630225p3646485.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave configuring clients

Posted by Vijay <vi...@gmail.com>.
Yes. I am using WinXP. Will try to run in linux and verify. Post the results
back here. Thanks.


boday wrote:
> 
> are you using Windows?  If so, you might see this bug 
> https://issues.apache.org/jira/browse/AMQ-3273 AMQ-3273 ...it caused me a
> lot of confusion while trying to test this scenario.
> 


--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-configuring-clients-tp3630225p3646323.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave configuring clients

Posted by boday <be...@initekconsulting.com>.
are you using Windows?  If so, you might see this bug 
https://issues.apache.org/jira/browse/AMQ-3273 AMQ-3273 ...it caused me a
lot of confusion while trying to test this scenario.


Vijay wrote:
> 
> I am rephrasing my question for get rid of confusion.
> 
> We have a Converter app (Standalone JMS consumer client based on Spring
> DefaultMessageListenerContainer) which will consume messages from AMQ
> Broker hosted on same server. An upstream system will publish messages on
> to "TEST.FOO"  Q on this broker. Whole purpose of convert app is to
> transform the message to another format and send it to downstream system
> for further processing.
> 
> 
> Server1 (working fine)
> -----------
> Consumer App
> Regular AMQ Broker
> 
> We verified this to be working fine with a consumer, AMQ broker on the
> same server.
> 
> For redundancy we want to  use Master/Slave Broker config + deploy one
> more Consumer app on server2.  This is the new config we have.  But this
> seem to be causing message loss. I am attaching a Junit test case to
> reproduce this.
> 
> Server1 
> -----------
> Consumer App 1 listening to tcp://server1:61616
> Master AMQ Broker (tcp://server1:61616)
> 
> Server2 
> -----------
> Consumer App 2  listening to tcp://server2:61617
> Slave AMQ Broker (tcp://server2:61617)
> 
> 
> 
> Attached is the JUnit test case:
> Steps
> 1. start master on 61616
> 2. Start slave on 61617
> 3. start consumer 1  to listen to tcp://host:61616
> 4. Start consumer2 to listen to tcp://host:61617
> 5. produce 30 msgs 
> Notice only part of message being consumed by listener 1
> 6. kill master and listener1
> 7. produce 50 msgs 
> Notice only part of messages being consumed by listener 1
> 7.kill slave
> 
> May I know what's wrong with this test case?
> 
> 
> http://activemq.2283324.n4.nabble.com/file/n3646271/MasterSlaveFailoverTestcase.zip
> MasterSlaveFailoverTestcase.zip 
> 


--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-configuring-clients-tp3630225p3646309.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave configuring clients

Posted by Vijay <vi...@gmail.com>.
I am rephrasing my question for get rid of confusion.

We have a Converter app (Standalone JMS consumer client based on Spring
DefaultMessageListenerContainer) which will consume messages from AMQ Broker
hosted on same server. An upstream system will publish messages on to
"TEST.FOO"  Q on this broker. Whole purpose of convert app is to transform
the message to another format and send it to downstream system for further
processing.


Server1 (working fine)
-----------
Consumer App
Regular AMQ Broker

We verified this to be working fine with a consumer, AMQ broker on the same
server.

For redundancy we want to  use Master/Slave Broker config + deploy one more
Consumer app on server2.  This is the new config we have.  But this seem to
be causing message loss. I am attaching a Junit test case to reproduce this.

Server1 
-----------
Consumer App 1 listening to tcp://server1:61616
Master AMQ Broker (tcp://server1:61616)

Server2 
-----------
Consumer App 2  listening to tcp://server2:61617
Slave AMQ Broker (tcp://server2:61617)



Attached is the JUnit test case:
Steps
1. start master on 61616
2. Start slave on 61617
3. start consumer 1  to listen to tcp://host:61616
4. Start consumer2 to listen to tcp://host:61617
5. produce 30 msgs 
Notice only part of message being consumed by listener 1
6. kill master and listener1
7. produce 50 msgs 
Notice only part of messages being consumed by listener 1
7.kill slave

May I know what's wrong with this test case?

http://activemq.2283324.n4.nabble.com/file/n3646271/MasterSlaveFailoverTestcase.zip
MasterSlaveFailoverTestcase.zip 



--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-configuring-clients-tp3630225p3646271.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave configuring clients

Posted by Vijay <vi...@gmail.com>.
Can anyone reply pls? This is an urgent issue for us. Thanks.

--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-configuring-clients-tp3630225p3638168.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave configuring clients

Posted by Vijay <vi...@gmail.com>.
Typo. 

I am using this :
For client 1: tcp://masterhost:port 
For client 2: tcp://slavehost:port 

--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-configuring-clients-tp3630225p3635592.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave configuring clients

Posted by Vijay <vi...@gmail.com>.
Slave broker is not usable until Master goes down. 

Currently I am configuring clients like this:

For client 1: tcp://masterhost:port
For client 2: vm://slavehost:port

This seem to be causing message loss. Any thoughts.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-configuring-clients-tp3630225p3635589.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Master/Slave configuring clients

Posted by boday <be...@initekconsulting.com>.
see http://activemq.apache.org/shared-file-system-master-slave.html

In short, consumers should use the following URLs.  If the consumers are
embedded in the brokers, then using VM for the transport appears to work
fine.  However, if the broker goes down, so does the consumer (generally)...

Consumer A
failover:(vm://serverA:61616,tcp://serverB:61617)

Consumer B
failover:(tcp://serverA:61616,vm://serverB:61617)


Vijay wrote:
> 
> We are implementing AMQ's master/slave broker topology to achieve
> geographic redundancy. 
> 
> Master is hosted on Server A and Slave is hosted on Server B. 
> 
> For geographic redundancy, we will have two consumer apps which will be
> hosted on the same servers. These consumers will consume a Q named
> "TEST.FOO" (an upstream system will produce the messages onto thsi Q using
> master/slave failover URL). So the idea is if Server A dies, Server B
> (slave) and its consumer should take over.
> 
> here is the setup in summary:
> 
> ServerA
> ----------
> Master (tcp://master:61616)
> Consumer A
> 
> ServerB
> ----------
> Slave (tcp://master:61617)
> Consumer B
> 
> 1. What URL should I use to configure both the consumers?
> 
> 2. Can I make use of VM protocol in my case, considering broker and
> consumer running on the same server to avoid tcp traffic? If yes, How does
> the URL look like>
> 


--
View this message in context: http://activemq.2283324.n4.nabble.com/Master-Slave-configuring-clients-tp3630225p3630926.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.