You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mffrench <mf...@axway.com> on 2009/03/09 16:40:06 UTC

Question about Active MQ network of brokers

Hello,

I would like to know if it's possible to configure ActiveMQ to route
messages from a broker A to a broker C through a broker B. In fact I aim to
achieve this kind of topology :

client X (network 1) send Message to Broker C via Broker A -> broker A
(network 1) send message to broker C via broker B -> broker B (network 1 and
network 2) send message to broker C-> broker C (network 2) <- client Y
(network 2) receive the message from client X

The broker B in fact is a kind of hub broker which links network 1 and
network 2. Client X is connected only on Broker A and can not send message
to network 2 without connecting to broker B. After reading the broker
network documentation I do not find the way to achieve this kind of
topology. Any idea ?

Thanks 
-- 
View this message in context: http://www.nabble.com/Question-about-Active-MQ-network-of-brokers-tp22413530p22413530.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Active MQ network of brokers

Posted by mffrench <mf...@axway.com>.
If I configure any network connector thanks AMQ API or JMX will this
configuration be persistent ?

++


mffrench wrote:
> 
> Is there any way to configure network connector through JMX ?
> 
> 
> bsnyder wrote:
>> 
>> On Tue, Mar 10, 2009 at 3:14 AM, mffrench <mf...@axway.com> wrote:
>>>
>>> Thank you for your answer. I'll try to make my topology thanks your
>>> advise.
>>> Anyway I've another question. Is there a dynamic way to configure
>>> network
>>> connector ? The only configuration way I found was editing xml
>>> configuration
>>> files (so a static configuration since you need to reboot activemq). Do
>>> I
>>> make a mistake ?
>> 
>> Network connectors can be configured in the XML configuration file or
>> if you're embedding ActiveMQ you can use the Java API.
>> 
>> Bruce
>> -- 
>> perl -e 'print
>> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> );'
>> 
>> Apache ActiveMQ - http://activemq.apache.org/
>> Apache Camel - http://camel.apache.org/
>> Apache ServiceMix - http://servicemix.apache.org/
>> 
>> Blog: http://bruceblog.org/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-about-Active-MQ-network-of-brokers-tp22413530p22476105.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Active MQ network of brokers

Posted by mffrench <mf...@axway.com>.
Is there any way to configure network connector through JMX ?


bsnyder wrote:
> 
> On Tue, Mar 10, 2009 at 3:14 AM, mffrench <mf...@axway.com> wrote:
>>
>> Thank you for your answer. I'll try to make my topology thanks your
>> advise.
>> Anyway I've another question. Is there a dynamic way to configure network
>> connector ? The only configuration way I found was editing xml
>> configuration
>> files (so a static configuration since you need to reboot activemq). Do I
>> make a mistake ?
> 
> Network connectors can be configured in the XML configuration file or
> if you're embedding ActiveMQ you can use the Java API.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.apache.org/
> Apache Camel - http://camel.apache.org/
> Apache ServiceMix - http://servicemix.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-about-Active-MQ-network-of-brokers-tp22413530p22455213.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Active MQ network of brokers

Posted by Joe Fernandez <jo...@ttmsolutions.com>.
One possible option is to leverage/extend the existing LDAP discovery
mechanism to make things a bit more dynamic wrt network connectors. 

http://activemq.apache.org/ldap-broker-discovery-mechanism.html

You could use the Apache DS, which btw rocks! 

Joe
http://www.ttmsolutions.com



bsnyder wrote:
> 
> On Tue, Mar 10, 2009 at 3:14 AM, mffrench <mf...@axway.com> wrote:
>>
>> Thank you for your answer. I'll try to make my topology thanks your
>> advise.
>> Anyway I've another question. Is there a dynamic way to configure network
>> connector ? The only configuration way I found was editing xml
>> configuration
>> files (so a static configuration since you need to reboot activemq). Do I
>> make a mistake ?
> 
> Network connectors can be configured in the XML configuration file or
> if you're embedding ActiveMQ you can use the Java API.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.apache.org/
> Apache Camel - http://camel.apache.org/
> Apache ServiceMix - http://servicemix.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-about-Active-MQ-network-of-brokers-tp22413530p22476456.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Active MQ network of brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Tue, Mar 10, 2009 at 3:14 AM, mffrench <mf...@axway.com> wrote:
>
> Thank you for your answer. I'll try to make my topology thanks your advise.
> Anyway I've another question. Is there a dynamic way to configure network
> connector ? The only configuration way I found was editing xml configuration
> files (so a static configuration since you need to reboot activemq). Do I
> make a mistake ?

Network connectors can be configured in the XML configuration file or
if you're embedding ActiveMQ you can use the Java API.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.apache.org/
Apache Camel - http://camel.apache.org/
Apache ServiceMix - http://servicemix.apache.org/

Blog: http://bruceblog.org/

Re: Question about Active MQ network of brokers

Posted by mffrench <mf...@axway.com>.
Thank you for your answer. I'll try to make my topology thanks your advise.
Anyway I've another question. Is there a dynamic way to configure network
connector ? The only configuration way I found was editing xml configuration
files (so a static configuration since you need to reboot activemq). Do I
make a mistake ?


bsnyder wrote:
> 
> On Mon, Mar 9, 2009 at 9:40 AM, mffrench <mf...@axway.com> wrote:
>>
>> Hello,
>>
>> I would like to know if it's possible to configure ActiveMQ to route
>> messages from a broker A to a broker C through a broker B. In fact I aim
>> to
>> achieve this kind of topology :
>>
>> client X (network 1) send Message to Broker C via Broker A -> broker A
>> (network 1) send message to broker C via broker B -> broker B (network 1
>> and
>> network 2) send message to broker C-> broker C (network 2) <- client Y
>> (network 2) receive the message from client X
>>
>> The broker B in fact is a kind of hub broker which links network 1 and
>> network 2. Client X is connected only on Broker A and can not send
>> message
>> to network 2 without connecting to broker B. After reading the broker
>> network documentation I do not find the way to achieve this kind of
>> topology. Any idea ?
> 
> I believe the topology you're describing is what I've outlined below:
> 
> ClientX --> BrokerA <--> BrokerB <-->BrokerC <-- ClientY
> 
> This is easily achievable via a network of brokers in ActiveMQ and
> something I demonstrate on a single machine quite often. (If you're
> running on a single machine, you just need to make sure to change all
> the necessary ports in the three brokers.) To achieve such a broker
> network, you need to define network connectors between the brokers:
> 
> http://activemq.apache.org/networks-of-brokers.html
> 
> Network connectors can be uni-directional or bi-directional based on
> the value of the duplex attribute on the connector. Setting duplex to
> true simplifies the network definition a bit because only one network
> connector needs to be defined between two brokers (one with
> duplex=true) instead of two (one in each direction, i.e., brokerA -->
> brokerB and brokerB --> brokerA).
> 
> Bear in mind that messages will not be broadcast around the network.
> You may already know this but I've found it's worth mentioning.
> Messages sent to BrokerA will stay there until there is demand for
> them on another broker in the network. Which leads to the correct
> configuration of the network connector to allow messages to make hops
> between brokers.
> 
> To allow messages to hop between brokers you need to be aware of is
> the networkTTL attribute on the network connector. This is what allows
> messages to make hops between brokers. By default, the networkTTL is
> set to 1. This means that messages can make one hop between brokers.
> With this default networkTTL value in your topology, messages sent to
> BrokerA would wind up on BrokerB and stay there. To allow them to flow
> from BrokerA to BrokerB to BrokerC, you will need to set the
> networkTTL to 2. This will allow messages to hop from BrokerA to
> BrokerB to BrokerC.
> 
> Hopefully that helps.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.apache.org/
> Apache Camel - http://camel.apache.org/
> Apache ServiceMix - http://servicemix.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-about-Active-MQ-network-of-brokers-tp22413530p22430453.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Active MQ network of brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Mon, Mar 23, 2009 at 11:34 AM, mffrench <mf...@axway.com> wrote:
>
> Thanks for your answer. Would like to know if there is a sense to raise a
> JIRA for this ? It could be a good way to simplify the configuration ...

Sure, for any improvements you'd like to see, please create a JIRA
issue to provide your explanation (and even a patch if you're so
inclined :-) ).

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.apache.org/
Apache Camel - http://camel.apache.org/
Apache ServiceMix - http://servicemix.apache.org/

Blog: http://bruceblog.org/

Re: Question about Active MQ network of brokers

Posted by mffrench <mf...@axway.com>.
Thanks for your answer. Would like to know if there is a sense to raise a
JIRA for this ? It could be a good way to simplify the configuration ...

++


bsnyder wrote:
> 
> On Mon, Mar 23, 2009 at 10:13 AM, mffrench <mf...@axway.com> wrote:
>>
>> About the networkTTL is there a way to set it to infinite value ???
> 
> There's no special value for that. The solution is to note the most
> amount of hops that a message might need to make across brokers to
> reach a subscription. Note that messages will not hop across a broker
> where they've already been.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.apache.org/
> Apache Camel - http://camel.apache.org/
> Apache ServiceMix - http://servicemix.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-about-Active-MQ-network-of-brokers-tp22413530p22664228.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Active MQ network of brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Mon, Mar 23, 2009 at 10:13 AM, mffrench <mf...@axway.com> wrote:
>
> About the networkTTL is there a way to set it to infinite value ???

There's no special value for that. The solution is to note the most
amount of hops that a message might need to make across brokers to
reach a subscription. Note that messages will not hop across a broker
where they've already been.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.apache.org/
Apache Camel - http://camel.apache.org/
Apache ServiceMix - http://servicemix.apache.org/

Blog: http://bruceblog.org/

Re: Question about Active MQ network of brokers

Posted by mffrench <mf...@axway.com>.
About the networkTTL is there a way to set it to infinite value ???

Thanks ...

++


bsnyder wrote:
> 
> On Mon, Mar 9, 2009 at 9:40 AM, mffrench <mf...@axway.com> wrote:
>>
>> Hello,
>>
>> I would like to know if it's possible to configure ActiveMQ to route
>> messages from a broker A to a broker C through a broker B. In fact I aim
>> to
>> achieve this kind of topology :
>>
>> client X (network 1) send Message to Broker C via Broker A -> broker A
>> (network 1) send message to broker C via broker B -> broker B (network 1
>> and
>> network 2) send message to broker C-> broker C (network 2) <- client Y
>> (network 2) receive the message from client X
>>
>> The broker B in fact is a kind of hub broker which links network 1 and
>> network 2. Client X is connected only on Broker A and can not send
>> message
>> to network 2 without connecting to broker B. After reading the broker
>> network documentation I do not find the way to achieve this kind of
>> topology. Any idea ?
> 
> I believe the topology you're describing is what I've outlined below:
> 
> ClientX --> BrokerA <--> BrokerB <-->BrokerC <-- ClientY
> 
> This is easily achievable via a network of brokers in ActiveMQ and
> something I demonstrate on a single machine quite often. (If you're
> running on a single machine, you just need to make sure to change all
> the necessary ports in the three brokers.) To achieve such a broker
> network, you need to define network connectors between the brokers:
> 
> http://activemq.apache.org/networks-of-brokers.html
> 
> Network connectors can be uni-directional or bi-directional based on
> the value of the duplex attribute on the connector. Setting duplex to
> true simplifies the network definition a bit because only one network
> connector needs to be defined between two brokers (one with
> duplex=true) instead of two (one in each direction, i.e., brokerA -->
> brokerB and brokerB --> brokerA).
> 
> Bear in mind that messages will not be broadcast around the network.
> You may already know this but I've found it's worth mentioning.
> Messages sent to BrokerA will stay there until there is demand for
> them on another broker in the network. Which leads to the correct
> configuration of the network connector to allow messages to make hops
> between brokers.
> 
> To allow messages to hop between brokers you need to be aware of is
> the networkTTL attribute on the network connector. This is what allows
> messages to make hops between brokers. By default, the networkTTL is
> set to 1. This means that messages can make one hop between brokers.
> With this default networkTTL value in your topology, messages sent to
> BrokerA would wind up on BrokerB and stay there. To allow them to flow
> from BrokerA to BrokerB to BrokerC, you will need to set the
> networkTTL to 2. This will allow messages to hop from BrokerA to
> BrokerB to BrokerC.
> 
> Hopefully that helps.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.apache.org/
> Apache Camel - http://camel.apache.org/
> Apache ServiceMix - http://servicemix.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-about-Active-MQ-network-of-brokers-tp22413530p22663483.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Active MQ network of brokers

Posted by mffrench <mf...@axway.com>.
You were right to underline this point I do not know :)

In fact I do not understand why the routing is done on the GET and not
directly on the PUT. I do not see the interest to keep the message in the
non final destination broker. For me this is a problem because that's mean
if you have N nodes there will be N-1 get requests. But there is certainly
some explanations I do not see.

++


bsnyder wrote:
> 
> On Mon, Mar 9, 2009 at 9:40 AM, mffrench <mf...@axway.com> wrote:
> 
> Bear in mind that messages will not be broadcast around the network.
> You may already know this but I've found it's worth mentioning.
> Messages sent to BrokerA will stay there until there is demand for
> them on another broker in the network. Which leads to the correct
> configuration of the network connector to allow messages to make hops
> between brokers.
> 

-- 
View this message in context: http://www.nabble.com/Question-about-Active-MQ-network-of-brokers-tp22413530p22455200.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Question about Active MQ network of brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Mon, Mar 9, 2009 at 9:40 AM, mffrench <mf...@axway.com> wrote:
>
> Hello,
>
> I would like to know if it's possible to configure ActiveMQ to route
> messages from a broker A to a broker C through a broker B. In fact I aim to
> achieve this kind of topology :
>
> client X (network 1) send Message to Broker C via Broker A -> broker A
> (network 1) send message to broker C via broker B -> broker B (network 1 and
> network 2) send message to broker C-> broker C (network 2) <- client Y
> (network 2) receive the message from client X
>
> The broker B in fact is a kind of hub broker which links network 1 and
> network 2. Client X is connected only on Broker A and can not send message
> to network 2 without connecting to broker B. After reading the broker
> network documentation I do not find the way to achieve this kind of
> topology. Any idea ?

I believe the topology you're describing is what I've outlined below:

ClientX --> BrokerA <--> BrokerB <-->BrokerC <-- ClientY

This is easily achievable via a network of brokers in ActiveMQ and
something I demonstrate on a single machine quite often. (If you're
running on a single machine, you just need to make sure to change all
the necessary ports in the three brokers.) To achieve such a broker
network, you need to define network connectors between the brokers:

http://activemq.apache.org/networks-of-brokers.html

Network connectors can be uni-directional or bi-directional based on
the value of the duplex attribute on the connector. Setting duplex to
true simplifies the network definition a bit because only one network
connector needs to be defined between two brokers (one with
duplex=true) instead of two (one in each direction, i.e., brokerA -->
brokerB and brokerB --> brokerA).

Bear in mind that messages will not be broadcast around the network.
You may already know this but I've found it's worth mentioning.
Messages sent to BrokerA will stay there until there is demand for
them on another broker in the network. Which leads to the correct
configuration of the network connector to allow messages to make hops
between brokers.

To allow messages to hop between brokers you need to be aware of is
the networkTTL attribute on the network connector. This is what allows
messages to make hops between brokers. By default, the networkTTL is
set to 1. This means that messages can make one hop between brokers.
With this default networkTTL value in your topology, messages sent to
BrokerA would wind up on BrokerB and stay there. To allow them to flow
from BrokerA to BrokerB to BrokerC, you will need to set the
networkTTL to 2. This will allow messages to hop from BrokerA to
BrokerB to BrokerC.

Hopefully that helps.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.apache.org/
Apache Camel - http://camel.apache.org/
Apache ServiceMix - http://servicemix.apache.org/

Blog: http://bruceblog.org/