network of brokers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

network of brokers

activemqer
Hi,
I'm trying to cluster two brokers on two separate machines. I'd like to post messages to broker A and the messages to flow to broker B so I have two brokers with same set of messages. I'd like this to be able to failover from one broker to the other in case of an outage.
The problem is I don't see the messages flow between the two brokers, they stay in the broker A's persistant storage. I found in the documentation that there is a way to enforce the message flow with the dynamicOnly set to false but it did not make any difference. Am I missing anything?

I have the following network connectors configured:
* on host A:
<networkConnector name="A and B" uri="static://(tcp://B:61616)" failover="true" dynamicOnly="false" networkTTL="10"/>

* on host B:
<networkConnector name="A and B" uri="static://(tcp://A:61616)" failover="true" dynamicOnly="false" networkTTL="10"/>

One more detail, if it helps, when I'm posting messages to the queue, there are no listeners on either broker.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: network of brokers

John Heitmann
What you may want instead is the staticallyIncludedDestinations  
feature. You could also use startup destinations.

In either case it won't match what you want since you're using  
queues. If you really want both A's consumers and B's consumers to  
receive the same set of messages, then you'll need to use a topic,  
and perhaps something like virtual destinations to bridge to a queue  
at each broker. Otherwise queue semantics hold even across the network.

It sounds like you may want to try out the master/slave feature  
instead if you care about both 0 message loss during failure and that  
a message must be consumed once and only once.

John

On Dec 28, 2006, at 7:32 AM, activemqer wrote:

>
> Hi,
> I'm trying to cluster two brokers on two separate machines. I'd  
> like to post
> messages to broker A and the messages to flow to broker B so I have  
> two
> brokers with same set of messages. I'd like this to be able to  
> failover from
> one broker to the other in case of an outage.
> The problem is I don't see the messages flow between the two  
> brokers, they
> stay in the broker A's persistant storage. I found in the  
> documentation that
> there is a way to enforce the message flow with the dynamicOnly set  
> to false
> but it did not make any difference. Am I missing anything?
>
> I have the following network connectors configured:
> * on host A:
> <networkConnector name="A and B" uri="static://(tcp://B:61616)"
> failover="true" dynamicOnly="false" networkTTL="10"/>
>
> * on host B:
> <networkConnector name="A and B" uri="static://(tcp://A:61616)"
> failover="true" dynamicOnly="false" networkTTL="10"/>
>
> One more detail, if it helps, when I'm posting messages to the  
> queue, there
> are no listeners on either broker.
>
> Thanks.
> --
> View this message in context: http://www.nabble.com/network-of- 
> brokers-tf2890777.html#a8076003
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: network of brokers

activemqer
I'm trying to achieve some kind of a load balancing in our project. I don't think that master/slave can solve that problem. It merely is a recovery mechanism, which is good but not good enough for me.

Just to clarify the reason I'm posting this message. I read on the the doc page that ActiveMQ supports distributed queues and the way to achieve that is to use a network of brokers. Is this still true? Because I don't see messages flow between brokers even when I subscribe to a queue on a broker that does not currently have any messages. May be I'm just misinterpreting the documentation.

http://www.activemq.org/site/how-do-distributed-queues-work.html

John Heitmann wrote
> It sounds like you may want to try out the master/slave feature  
> instead if you care about both 0 message loss during failure and that  
> a message must be consumed once and only once.

John

On Dec 28, 2006, at 7:32 AM, activemqer wrote:

>
> Hi,
> I'm trying to cluster two brokers on two separate machines. I'd  
> like to post
> messages to broker A and the messages to flow to broker B so I have  
> two
> brokers with same set of messages. I'd like this to be able to  
> failover from
> one broker to the other in case of an outage.
> The problem is I don't see the messages flow between the two  
> brokers, they
> stay in the broker A's persistant storage. I found in the  
> documentation that
> there is a way to enforce the message flow with the dynamicOnly set  
> to false
> but it did not make any difference. Am I missing anything?
>
> I have the following network connectors configured:
> * on host A:
> <networkConnector name="A and B" uri="static://(tcp://B:61616)"
> failover="true" dynamicOnly="false" networkTTL="10"/>
>
> * on host B:
> <networkConnector name="A and B" uri="static://(tcp://A:61616)"
> failover="true" dynamicOnly="false" networkTTL="10"/>
>
> One more detail, if it helps, when I'm posting messages to the  
> queue, there
> are no listeners on either broker.
>
> Thanks.
> --
> View this message in context: http://www.nabble.com/network-of- 
> brokers-tf2890777.html#a8076003
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: network of brokers

Marlon Santos
Hi,

AFAIK, it's still supported. If you want to see the message flow, create a publisher/producer on brokerA and have a consumer/listener on brokerB which consumes the messages on the queue on brokerA.

The messages are only distributed to other brokers or clients when there is a request for the message on the queue. So you were not seeing the message flow on your case because maybe you dont have a consumer/client requesting for the message.

Regards,
Marlon


activemqer wrote
I'm trying to achieve some kind of a load balancing in our project. I don't think that master/slave can solve that problem. It merely is a recovery mechanism, which is good but not good enough for me.

Just to clarify the reason I'm posting this message. I read on the the doc page that ActiveMQ supports distributed queues and the way to achieve that is to use a network of brokers. Is this still true? Because I don't see messages flow between brokers even when I subscribe to a queue on a broker that does not currently have any messages. May be I'm just misinterpreting the documentation.

http://www.activemq.org/site/how-do-distributed-queues-work.html

John Heitmann wrote
> It sounds like you may want to try out the master/slave feature  
> instead if you care about both 0 message loss during failure and that  
> a message must be consumed once and only once.

John

On Dec 28, 2006, at 7:32 AM, activemqer wrote:

>
> Hi,
> I'm trying to cluster two brokers on two separate machines. I'd  
> like to post
> messages to broker A and the messages to flow to broker B so I have  
> two
> brokers with same set of messages. I'd like this to be able to  
> failover from
> one broker to the other in case of an outage.
> The problem is I don't see the messages flow between the two  
> brokers, they
> stay in the broker A's persistant storage. I found in the  
> documentation that
> there is a way to enforce the message flow with the dynamicOnly set  
> to false
> but it did not make any difference. Am I missing anything?
>
> I have the following network connectors configured:
> * on host A:
> <networkConnector name="A and B" uri="static://(tcp://B:61616)"
> failover="true" dynamicOnly="false" networkTTL="10"/>
>
> * on host B:
> <networkConnector name="A and B" uri="static://(tcp://A:61616)"
> failover="true" dynamicOnly="false" networkTTL="10"/>
>
> One more detail, if it helps, when I'm posting messages to the  
> queue, there
> are no listeners on either broker.
>
> Thanks.
> --
> View this message in context: http://www.nabble.com/network-of- 
> brokers-tf2890777.html#a8076003
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: network of brokers

Marlon Santos
Hi,

One more thing, this was in the docs that you referred to.

"At any point in time the message will only exist in one broker's store at once until its consumed. In the future we will support high availability brokers using a master-slave protocol where we willl replicate a message on to a number of slave brokers for hot standby if the master broker were to be unavailable for a certain period of time."

Which means that you have to use a master/slave topology because it is not possible to have two brokers to have the same set of messages, which is what you wanted...

Regards,
Marlon