You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by GeekPro <ki...@yahoo.com> on 2008/02/13 20:22:09 UTC

Regarding Store and Forward: Network of Brokers

HI

Config:

Amq - 5.0
OS - Linux


I configured the network of brokers by creating multiple instances of the
amq. I have a question like if I produce a message to the one of the broker
in the network lets say broker1 using failover protocol does the message
gets forwarded to the remaining brokers. please let me know whether I am in
the right direction, if not pls tell me how can achive it. It would be great
if you can respond me asap.

Thanks
Gi

-- 
View this message in context: http://www.nabble.com/Regarding-Store-and-Forward%3A-Network-of-Brokers-tp15464878s2354p15464878.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Regarding Store and Forward: Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Fri, Feb 15, 2008 at 9:23 AM, GeekPro <ki...@yahoo.com> wrote:
...
>  >>  When I configured with 4 brokers with mesh top'lgy
>  >>  a->b , c , d.
>  >>  b-> a , c , d
>  >>  c-> a, b , d
>  >>  d-> a, b, c
>  >>
>  >>  It didn't worked when the brokers in the network are more than 2. If
>  >> there
>  >>  is anything else I need to do please let me know
>  >
>  > Does each network connector in each broker specify the correct
>  > networkTTL for hops to make? Each one should specify 3 for messages to
>  > make it from one end to the other in a linear topology. But it's
>  > possible that you may not need this much if you're configuring a mesh
>  > topology.
...
>  Yes I did Configured with mesh topology. Made the network ttl to 5. Yes I
>  mentioned all the 3 other broker address as I mentioned above. but its
>  wirking with 2 brokers but it is not working with 4 brokers also I wud like
>  to mention once again that I am using Linux OS. Please let me know if
>  anything else I need to configure.

So you can make this work with two brokers, correct? If so, making it
work with three and four brokers is no different. It's just a matter
of making sure that you have network connectors pointing from
broker-to-broker to support the store-and-forward functionality.

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Regarding Store and Forward: Network of Brokers

Posted by GeekPro <ki...@yahoo.com>.


bsnyder wrote:
> 
> On Thu, Feb 14, 2008 at 6:02 PM, GeekPro <ki...@yahoo.com> wrote:
> 
>>  Thanku so much...
>>  Finally I configured with 2 brokers pointing each other
>>  A->b and b->A
>>  It worked fine.
>>
>>  When I configured with 4 brokers with mesh top'lgy
>>  a->b , c , d.
>>  b-> a , c , d
>>  c-> a, b , d
>>  d-> a, b, c
>>
>>  It didn't worked when the brokers in the network are more than 2. If
>> there
>>  is anything else I need to do please let me know
> 
> Does each network connector in each broker specify the correct
> networkTTL for hops to make? Each one should specify 3 for messages to
> make it from one end to the other in a linear topology. But it's
> possible that you may not need this much if you're configuring a mesh
> topology.
> 
> 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.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 



Yes I did Configured with mesh topology. Made the network ttl to 5. Yes I
mentioned all the 3 other broker address as I mentioned above. but its
wirking with 2 brokers but it is not working with 4 brokers also I wud like
to mention once again that I am using Linux OS. Please let me know if
anything else I need to configure.

Thanks
Gi

-- 
View this message in context: http://www.nabble.com/Regarding-Store-and-Forward%3A-Network-of-Brokers-tp15464878s2354p15502684.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Regarding Store and Forward: Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Thu, Feb 14, 2008 at 6:02 PM, GeekPro <ki...@yahoo.com> wrote:

>  Thanku so much...
>  Finally I configured with 2 brokers pointing each other
>  A->b and b->A
>  It worked fine.
>
>  When I configured with 4 brokers with mesh top'lgy
>  a->b , c , d.
>  b-> a , c , d
>  c-> a, b , d
>  d-> a, b, c
>
>  It didn't worked when the brokers in the network are more than 2. If there
>  is anything else I need to do please let me know

Does each network connector in each broker specify the correct
networkTTL for hops to make? Each one should specify 3 for messages to
make it from one end to the other in a linear topology. But it's
possible that you may not need this much if you're configuring a mesh
topology.

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Regarding Store and Forward: Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Feb 18, 2008 1:08 PM, wha <wi...@cgi.com> wrote:
>
>
> How did you make it work ?
>
> I've been trying forever to make my brokerA talk to my BrokerB
>
> I have the following setup:
>
> Consumer -> BrokerB <--> BrokerA <- Producer
>
> My messages get stuck on Broker A, even though network connection between
> BrokerA and BrokerB has been established. I have set dynamicOnly to true and
> networkTTL to 2.
>
> Did you do anything else extra? My messages are not being forwarded from
> BrokerA to BrokerB :(

First make it work without using dynamicOnly, just in case there is a
bug with it. To do this, just set up a network connector in brokerA
that points to brokerB as well as a network connector in brokerB that
points to brokerA. Below is an example:

brokerA:
<networkConnectors>
      <networkConnector name="brokerA" networkTTL="2"
uri="static://(tcp://localhost:61612)"/>
</networkConnectors>

brokerB:
<networkConnectors>
      <networkConnector name="brokerB" networkTTL="2"
uri="static://(tcp://localhost:61611)"/>
</networkConnectors>

Then just start up the consumer on brokerA like so:

$ ant consumer -Durl=tcp://localhost:61611

And now start up the producer like so:

 ant producer -Durl=tcp://localhost:61612

The producer will send 10 messages and shut down and the consumer will
receive 10 messages and shut down.

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Regarding Store and Forward: Network of Brokers

Posted by wha <wi...@cgi.com>.

How did you make it work ?

I've been trying forever to make my brokerA talk to my BrokerB

I have the following setup:

Consumer -> BrokerB <--> BrokerA <- Producer

My messages get stuck on Broker A, even though network connection between
BrokerA and BrokerB has been established. I have set dynamicOnly to true and
networkTTL to 2.

Did you do anything else extra? My messages are not being forwarded from
BrokerA to BrokerB :(

Any help appreciated.


GeekPro wrote:
> 
> 
> Thanku so much...
> Finally I configured with 2 brokers pointing each other
> A->b and b->A
> It worked fine. 
> 
> When I configured with 4 brokers with mesh top'lgy
> a->b , c , d.
> b-> a , c , d
> c-> a, b , d
> d-> a, b, c
> 
> It didn't worked when the brokers in the network are more than 2. If there
> is anything else I need to do please let me know
> 
> Thanks
> Gi
> 
> 

-- 
View this message in context: http://www.nabble.com/Regarding-Store-and-Forward%3A-Network-of-Brokers-tp15464878s2354p15548766.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Regarding Store and Forward: Network of Brokers

Posted by GeekPro <ki...@yahoo.com>.


bsnyder wrote:
> 
> On Wed, Feb 13, 2008 at 5:42 PM, GeekPro <ki...@yahoo.com> wrote:
> 
>>  FYI-- I am using hermes tool along with ActiveMQ for producing and
>> consuming
>>  messages.
>>  YES I am using Topics but I didn't get the messages on both the
>> listeners (I
>>  got it only on one)
> 
> This is possible because the functionality of the failover://
> composite transport is to connect to a single broker in the list at
> random. And if the brokers are not configured to talk to one another
> via the network connector configuration, then messages may not flow
> the way you want.
> 
>>  Yes I am interested in failover -(Subscriber) and also (Producer)
>>  Below is the code which I am using on the Client side for producing and
>>  consuming messages
>>
>>  Note: I am using different IP address
>>
>>  Producer : failover://(tcp://10.0.0.1:61616,tcp://10.0.0.2:62626)
>>  Subscriber: failover://(tcp://10.0.0.1:61616,tcp://10.0.0.2:62626)
>>
>>  Lets say when we produce the message it went to 62626.
>>  But when we consume with the uri mentioned above I am not getting the
>>  message.
>>  Please tell me whether its a conf problem or my assumption is wrong.
> 
> I can't say for sure without knowing how the network connectors are
> configured in each broker. They will need to point at one another for
> broker-to-broker communication so that the store-and-forward
> functionality works the way you want it to. The other thing that I
> touched on before is that there is no point in having a broker point
> to itself. So if you are only using two brokers, you only need to
> point at the other broker via the network connector configuration
> using the static:// composite transport.
> 
> I just tested this using two brokers, each pointing at the other via
> the network connector configuration in each broker using the static://
> composite transport. Then I ran the consumer using the following
> command:
> 
> $ ant consumer -Dtopic=true
> -Durl="failover://(tcp://localhost:61611,tcp://localhost:61612)"
> 
> And then I ran the producer using the following command:
> 
> $ ant producer -Dtopic=true
> -Durl="failover://(tcp://localhost:61611,tcp://localhost:61612)"
> 
> The consumer connected to 61611 and waited for 10 messages. The
> producer connected to 61612 and sent 10 messages and shut down. The
> consumer that was connected to 61611 then received 10 messages and
> shut down.
> 
> I think your configuration is not set correctly for the
> broker-to-broker configuration.
> 
> 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.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 


Thanku so much...
Finally I configured with 2 brokers pointing each other
A->b and b->A
It worked fine. 

When I configured with 4 brokers with mesh top'lgy
a->b , c , d.
b-> a , c , d
c-> a, b , d
d-> a, b, c

It didn't worked when the brokers in the network are more than 2. If there
is anything else I need to do please let me know

Thanks
Gi

-- 
View this message in context: http://www.nabble.com/Regarding-Store-and-Forward%3A-Network-of-Brokers-tp15464878s2354p15493000.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Regarding Store and Forward: Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Feb 13, 2008 at 5:42 PM, GeekPro <ki...@yahoo.com> wrote:

>  FYI-- I am using hermes tool along with ActiveMQ for producing and consuming
>  messages.
>  YES I am using Topics but I didn't get the messages on both the listeners (I
>  got it only on one)

This is possible because the functionality of the failover://
composite transport is to connect to a single broker in the list at
random. And if the brokers are not configured to talk to one another
via the network connector configuration, then messages may not flow
the way you want.

>  Yes I am interested in failover -(Subscriber) and also (Producer)
>  Below is the code which I am using on the Client side for producing and
>  consuming messages
>
>  Note: I am using different IP address
>
>  Producer : failover://(tcp://10.0.0.1:61616,tcp://10.0.0.2:62626)
>  Subscriber: failover://(tcp://10.0.0.1:61616,tcp://10.0.0.2:62626)
>
>  Lets say when we produce the message it went to 62626.
>  But when we consume with the uri mentioned above I am not getting the
>  message.
>  Please tell me whether its a conf problem or my assumption is wrong.

I can't say for sure without knowing how the network connectors are
configured in each broker. They will need to point at one another for
broker-to-broker communication so that the store-and-forward
functionality works the way you want it to. The other thing that I
touched on before is that there is no point in having a broker point
to itself. So if you are only using two brokers, you only need to
point at the other broker via the network connector configuration
using the static:// composite transport.

I just tested this using two brokers, each pointing at the other via
the network connector configuration in each broker using the static://
composite transport. Then I ran the consumer using the following
command:

$ ant consumer -Dtopic=true
-Durl="failover://(tcp://localhost:61611,tcp://localhost:61612)"

And then I ran the producer using the following command:

$ ant producer -Dtopic=true
-Durl="failover://(tcp://localhost:61611,tcp://localhost:61612)"

The consumer connected to 61611 and waited for 10 messages. The
producer connected to 61612 and sent 10 messages and shut down. The
consumer that was connected to 61611 then received 10 messages and
shut down.

I think your configuration is not set correctly for the
broker-to-broker configuration.

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Regarding Store and Forward: Network of Brokers

Posted by GeekPro <ki...@yahoo.com>.


bsnyder wrote:
> 
> On Feb 13, 2008 4:17 PM, GeekPro <ki...@yahoo.com> wrote:
> 
>> I mean the transportConnector Address..NeverMind I am clear in this but
>> comming to our networkConnector
>>
>> In broker1 the network Connector  will have the
>>
>> uri = "static:(tcp://10.0.0.2:62626)"
>>
>> In broker2 the network Connector  will have th
>>
>> uri = "static:(tcp://10.0.0.2:61616)"
>>
>>
>> Step 1:
>> So from the Subscriber I had 2 instances one is listening to 61616 and
>> the
>> other with 62626(with out failover protocol)
> 
> OK, you have a subscriber pointing to each broker.
> 
>> Here in step1 if the 61616 gets the message then listener with 62626 is
>> not
>> getting the messagep
> 
> If you're expecting each subscriber to get a copy of the messages
> you're sending, you'll need to use topics.
> 
>> Step2 :
>>
>> I have one more instance  which is listening to both 61616 and 62626
>> (with
>> failover protocol)
>>
>> Here if the message goes to 62626 then the listener can't get the message
>> in
>> the failover I mentioned 61616 address as the first arg.
> 
> Well if you're using failover, then a random connection will be made
> one of the brokers. I doubt this is the behavior that you want.
> 
> The easiest way to test any topology with ActiveMQ is using the
> consumer/producer examples that come with ActiveMQ. I just did this,
> in fact. I configured three brokers, brokerA points to brokerB,
> brokerB points to brokerA and brokerC, brokerC points to brokerB. So I
> have a linear topology that looks like this:
> 
> brokerB(61611) <--> brokerB(61612) <--> brokerC(61613)
> 
> In one terminal, I cd into the the ActiveMQ example directory and I
> run 'ant consumer -Durl=tcp://localhost:61611'. Then in another
> terminal, I cd into the ActiveMQ example directory and I run 'ant
> producer -Durl=tcp://localhost:61613'. The messages are produced to
> brokerC and the consumer on brokerA consumes them. This is a very
> basic example but the example consumer and producer that come with
> ActiveMQ have many, many options allowing you to test any topology
> quite easily.
> 
> 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.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 


FYI-- I am using hermes tool along with ActiveMQ for producing and consuming
messages.
YES I am using Topics but I didn't get the messages on both the listeners (I
got it only on one)
Yes I am interested in failover -(Subscriber) and also (Producer)
Below is the code which I am using on the Client side for producing and
consuming messages

Note: I am using different IP address

Producer : failover://(tcp://10.0.0.1:61616,tcp://10.0.0.2:62626)
Subscriber: failover://(tcp://10.0.0.1:61616,tcp://10.0.0.2:62626)

Lets say when we produce the message it went to 62626.
But when we consume with the uri mentioned above I am not getting the
message. 
Please tell me whether its a conf problem or my assumption is wrong.

Thanks
Gi






-- 
View this message in context: http://www.nabble.com/Regarding-Store-and-Forward%3A-Network-of-Brokers-tp15464878s2354p15471571.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Regarding Store and Forward: Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Feb 13, 2008 4:17 PM, GeekPro <ki...@yahoo.com> wrote:

> I mean the transportConnector Address..NeverMind I am clear in this but
> comming to our networkConnector
>
> In broker1 the network Connector  will have the
>
> uri = "static:(tcp://10.0.0.2:62626)"
>
> In broker2 the network Connector  will have th
>
> uri = "static:(tcp://10.0.0.2:61616)"
>
>
> Step 1:
> So from the Subscriber I had 2 instances one is listening to 61616 and the
> other with 62626(with out failover protocol)

OK, you have a subscriber pointing to each broker.

> Here in step1 if the 61616 gets the message then listener with 62626 is not
> getting the messagep

If you're expecting each subscriber to get a copy of the messages
you're sending, you'll need to use topics.

> Step2 :
>
> I have one more instance  which is listening to both 61616 and 62626 (with
> failover protocol)
>
> Here if the message goes to 62626 then the listener can't get the message in
> the failover I mentioned 61616 address as the first arg.

Well if you're using failover, then a random connection will be made
one of the brokers. I doubt this is the behavior that you want.

The easiest way to test any topology with ActiveMQ is using the
consumer/producer examples that come with ActiveMQ. I just did this,
in fact. I configured three brokers, brokerA points to brokerB,
brokerB points to brokerA and brokerC, brokerC points to brokerB. So I
have a linear topology that looks like this:

brokerB(61611) <--> brokerB(61612) <--> brokerC(61613)

In one terminal, I cd into the the ActiveMQ example directory and I
run 'ant consumer -Durl=tcp://localhost:61611'. Then in another
terminal, I cd into the ActiveMQ example directory and I run 'ant
producer -Durl=tcp://localhost:61613'. The messages are produced to
brokerC and the consumer on brokerA consumes them. This is a very
basic example but the example consumer and producer that come with
ActiveMQ have many, many options allowing you to test any topology
quite easily.

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Regarding Store and Forward: Network of Brokers

Posted by GeekPro <ki...@yahoo.com>.


bsnyder wrote:
> 
> On Feb 13, 2008 3:34 PM, GeekPro <ki...@yahoo.com> wrote:
> 
>> Here is the uri
>>
>> I am using 2 different IP addresses
>>
>> uri = "static:(tcp://10.0.0.1:61616,tcp://10.0.0.2:62626)"
>>
>> tcp://10.0.0.1:61616 -- Broker1
>> tcp://10.0.0.2:62626 --  Broker 2
> 
> OK, two things:
> 
> 1) You don't want broker1 pointing at itself; that's pointless
> 2) Using multiple broker addresses means it will *randomly* connect to
> *one* of the others
> 
> Let's say you have three brokers, you'd need to connect them in a
> linear topology or a mesh topology.
> 
> Linear:
> brokerA <--> brokerB <--> brokerC
> 
> Mesh:
> where every broker points to every other broker
> 
>> Also here I have one more question do the transportConnector uri should
>> be
>> different from the networkConnector uri because I am using the same as
>> mentioned address for both broker1 and broker2.
> 
> I'm not sure what you mean when you say you are using the same
> mentioned address for both broker1 and broker2. Please clarify this.
> 
> 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.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 


I mean the transportConnector Address..NeverMind I am clear in this but
comming to our networkConnector

In broker1 the network Connector  will have the 

uri = "static:(tcp://10.0.0.2:62626)"

In broker2 the network Connector  will have th

uri = "static:(tcp://10.0.0.2:61616)"


Step 1:
So from the Subscriber I had 2 instances one is listening to 61616 and the
other with 62626(with out failover protocol) 

Here in step1 if the 61616 gets the message then listener with 62626 is not
getting the messagep


Step2 :

I have one more instance  which is listening to both 61616 and 62626 (with
failover protocol)

Here if the message goes to 62626 then the listener can't get the message in
the failover I mentioned 61616 address as the first arg.


It wud b grt if u can help me in this reg

Thanks For all ur help
Gi







-- 
View this message in context: http://www.nabble.com/Regarding-Store-and-Forward%3A-Network-of-Brokers-tp15464878s2354p15470236.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Regarding Store and Forward: Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Feb 13, 2008 3:34 PM, GeekPro <ki...@yahoo.com> wrote:

> Here is the uri
>
> I am using 2 different IP addresses
>
> uri = "static:(tcp://10.0.0.1:61616,tcp://10.0.0.2:62626)"
>
> tcp://10.0.0.1:61616 -- Broker1
> tcp://10.0.0.2:62626 --  Broker 2

OK, two things:

1) You don't want broker1 pointing at itself; that's pointless
2) Using multiple broker addresses means it will *randomly* connect to
*one* of the others

Let's say you have three brokers, you'd need to connect them in a
linear topology or a mesh topology.

Linear:
brokerA <--> brokerB <--> brokerC

Mesh:
where every broker points to every other broker

> Also here I have one more question do the transportConnector uri should be
> different from the networkConnector uri because I am using the same as
> mentioned address for both broker1 and broker2.

I'm not sure what you mean when you say you are using the same
mentioned address for both broker1 and broker2. Please clarify this.

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Regarding Store and Forward: Network of Brokers

Posted by GeekPro <ki...@yahoo.com>.


bsnyder wrote:
> 
> On Feb 13, 2008 3:09 PM, GeekPro <ki...@yahoo.com> wrote:
> 
>> Thanqs for the info..
>> I configured the broker1 networkConnector as shown below
>>
>> <networkConnector  name="x"
>>                             networkTTL = "2"
>>                             uri="broker1,broker2 addresses" />
>>
>>
>> when I am listening to broker1 and broker 2 seperate client. I was able
>> to
>> get the msg from broker1 and from broker2 I am not getting any msg.
> 
> What is the URI you're using for the network connector? You will need
> each broker to define a network connector pointing to one another.
> I've configured this many times myself in many different situations so
> I know it works.
> 
> 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.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 



Here is the uri 

I am using 2 different IP addresses

uri = "static:(tcp://10.0.0.1:61616,tcp://10.0.0.2:62626)"

tcp://10.0.0.1:61616 -- Broker1
tcp://10.0.0.2:62626 --  Broker 2

Also here I have one more question do the transportConnector uri should be
different from the networkConnector uri because I am using the same as
mentioned address for both broker1 and broker2.


Thanks
GI
-- 
View this message in context: http://www.nabble.com/Regarding-Store-and-Forward%3A-Network-of-Brokers-tp15464878s2354p15469502.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Regarding Store and Forward: Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Feb 13, 2008 3:09 PM, GeekPro <ki...@yahoo.com> wrote:

> Thanqs for the info..
> I configured the broker1 networkConnector as shown below
>
> <networkConnector  name="x"
>                             networkTTL = "2"
>                             uri="broker1,broker2 addresses" />
>
>
> when I am listening to broker1 and broker 2 seperate client. I was able to
> get the msg from broker1 and from broker2 I am not getting any msg.

What is the URI you're using for the network connector? You will need
each broker to define a network connector pointing to one another.
I've configured this many times myself in many different situations so
I know it works.

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Regarding Store and Forward: Network of Brokers

Posted by GeekPro <ki...@yahoo.com>.


bsnyder wrote:
> 
> On Feb 13, 2008 2:30 PM, GeekPro <ki...@yahoo.com> wrote:
> 
>> Thanqs alot for the quick response. Actually I am new to ActiveMQ I was
>> not
>> aware of the ttl config can you tell where exactly in the activemq.xml do
>> I
>> need to do what I shud do (Ex: 6 brokers in the network)
> 
> The networkTTL option is documented on the Network of Brokers pages on
> the ActiveMQ website:
> 
> http://activemq.apache.org/networks-of-brokers.html
> 
> This option is configured on the network connector (the network
> connector is for broker-to-broker communications).
> 
>> So according to you if we can configure accordingly we can publish to one
>> broker and if the broker to which we sent is up still that broker will
>> forward the messages to other brokers in the network. If I am wrong pls
>> correct me because i.e our main requirement so that if any message is
>> published to one broker we can connect all the other brokers with
>> seperate
>> client and consume the same message.
> 
> Yes, that is exactly how store-and-forward works in ActiveMQ. However,
> messages will not traverse the broker network correctly without the
> networkTTL set to the number of hops messages need to make.
> 
> 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.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 



Hi

Thanqs for the info..
I configured the broker1 networkConnector as shown below

<networkConnector  name="x"  
                            networkTTL = "2"
                            uri="broker1,broker2 addresses" />


when I am listening to broker1 and broker 2 seperate client. I was able to
get the msg from broker1 and from broker2 I am not getting any msg.

Pls tell me if any other elements I need to include. I appreciate your help


Thanks
GI
-- 
View this message in context: http://www.nabble.com/Regarding-Store-and-Forward%3A-Network-of-Brokers-tp15464878s2354p15469139.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Regarding Store and Forward: Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Feb 13, 2008 2:30 PM, GeekPro <ki...@yahoo.com> wrote:

> Thanqs alot for the quick response. Actually I am new to ActiveMQ I was not
> aware of the ttl config can you tell where exactly in the activemq.xml do I
> need to do what I shud do (Ex: 6 brokers in the network)

The networkTTL option is documented on the Network of Brokers pages on
the ActiveMQ website:

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

This option is configured on the network connector (the network
connector is for broker-to-broker communications).

> So according to you if we can configure accordingly we can publish to one
> broker and if the broker to which we sent is up still that broker will
> forward the messages to other brokers in the network. If I am wrong pls
> correct me because i.e our main requirement so that if any message is
> published to one broker we can connect all the other brokers with seperate
> client and consume the same message.

Yes, that is exactly how store-and-forward works in ActiveMQ. However,
messages will not traverse the broker network correctly without the
networkTTL set to the number of hops messages need to make.

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Regarding Store and Forward: Network of Brokers

Posted by GeekPro <ki...@yahoo.com>.


bsnyder wrote:
> 
> On Feb 13, 2008 12:22 PM, GeekPro <ki...@yahoo.com> wrote:
>>
>> HI
>>
>> Config:
>>
>> Amq - 5.0
>> OS - Linux
>>
>>
>> I configured the network of brokers by creating multiple instances of the
>> amq. I have a question like if I produce a message to the one of the
>> broker
>> in the network lets say broker1 using failover protocol does the message
>> gets forwarded to the remaining brokers. please let me know whether I am
>> in
>> the right direction, if not pls tell me how can achive it. It would be
>> great
>> if you can respond me asap.
> 
> In a network of brokers, messages will be forwarded to the broker
> where there is demand for the messages, but only if the networkTTL
> option is set correctly for messages to make the correct number of
> hops across the number of brokers in the network.
> 
> 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.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

Thanqs alot for the quick response. Actually I am new to ActiveMQ I was not
aware of the ttl config can you tell where exactly in the activemq.xml do I
need to do what I shud do (Ex: 6 brokers in the network)
So according to you if we can configure accordingly we can publish to one
broker and if the broker to which we sent is up still that broker will
forward the messages to other brokers in the network. If I am wrong pls
correct me because i.e our main requirement so that if any message is
published to one broker we can connect all the other brokers with seperate
client and consume the same message.

I would appreciate if you can reply me....As I am new please excuse me if my
assumption is wrong.

Thanks
Gi

-- 
View this message in context: http://www.nabble.com/Regarding-Store-and-Forward%3A-Network-of-Brokers-tp15464878s2354p15468401.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Regarding Store and Forward: Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On Feb 13, 2008 12:22 PM, GeekPro <ki...@yahoo.com> wrote:
>
> HI
>
> Config:
>
> Amq - 5.0
> OS - Linux
>
>
> I configured the network of brokers by creating multiple instances of the
> amq. I have a question like if I produce a message to the one of the broker
> in the network lets say broker1 using failover protocol does the message
> gets forwarded to the remaining brokers. please let me know whether I am in
> the right direction, if not pls tell me how can achive it. It would be great
> if you can respond me asap.

In a network of brokers, messages will be forwarded to the broker
where there is demand for the messages, but only if the networkTTL
option is set correctly for messages to make the correct number of
hops across the number of brokers in the network.

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/