You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by riteshtijoriwala <ri...@yahoo.com> on 2009/05/03 09:30:16 UTC
How to preserve order of messages in Network of Brokers?
I have two consumers C1 and C2 and two brokers B1 and B2 that see each other.
I have one producer P1.
P1 is connected initially to B1 and C2 is connected to B1. C1 is connected
to B2. The initial start is as follows:
P1 produces 1, 2, 3, 4, 5, 6, (B1 failed), 7, 8, 9, 10.
C1 gets 1, 3, 5, 7, 9, 8
C2 gets 2, 4, 6, (B1 failed), 10
As seen above, I fail B1. P1 and C2 failover to B2. But now the strange
things happen. C1 starts to get messages out of order. Is there a way to
prevent this? How can I ensure that in case of broker failure, after
failover has occurred, consumers will receive messages in order.
To be specific, how can I assure that msg # 8 is processed before message #
9 & 10?
--
View this message in context: http://www.nabble.com/How-to-preserve-order-of-messages-in-Network-of-Brokers--tp23353328p23353328.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: How to preserve order of messages in Network of Brokers?
Posted by riteshtijoriwala <ri...@yahoo.com>.
Thanks Bruce.
bsnyder wrote:
>
> On Sun, May 3, 2009 at 1:30 AM, riteshtijoriwala
> <ri...@yahoo.com> wrote:
>>
>> I have two consumers C1 and C2 and two brokers B1 and B2 that see each
>> other.
>> I have one producer P1.
>>
>> P1 is connected initially to B1 and C2 is connected to B1. C1 is
>> connected
>> to B2. The initial start is as follows:
>>
>> P1 produces 1, 2, 3, 4, 5, 6, (B1 failed), 7, 8, 9, 10.
>> C1 gets 1, 3, 5, 7, 9, 8
>> C2 gets 2, 4, 6, (B1 failed), 10
>>
>> As seen above, I fail B1. P1 and C2 failover to B2. But now the strange
>> things happen. C1 starts to get messages out of order. Is there a way to
>> prevent this? How can I ensure that in case of broker failure, after
>> failover has occurred, consumers will receive messages in order.
>>
>> To be specific, how can I assure that msg # 8 is processed before message
>> #
>> 9 & 10?
>
> There is currently no way on the broker side to preserve message order
> with multiple brokers.
>
> Bruce
> --
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> ActiveMQ in Action: http://bit.ly/2je6cQ
> Blog: http://bruceblog.org/
> Twitter: http://twitter.com/brucesnyder
>
>
--
View this message in context: http://www.nabble.com/How-to-preserve-order-of-messages-in-Network-of-Brokers--tp23353328p23396152.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: How to preserve order of messages in Network of Brokers?
Posted by Bruce Snyder <br...@gmail.com>.
On Sun, May 3, 2009 at 1:30 AM, riteshtijoriwala
<ri...@yahoo.com> wrote:
>
> I have two consumers C1 and C2 and two brokers B1 and B2 that see each other.
> I have one producer P1.
>
> P1 is connected initially to B1 and C2 is connected to B1. C1 is connected
> to B2. The initial start is as follows:
>
> P1 produces 1, 2, 3, 4, 5, 6, (B1 failed), 7, 8, 9, 10.
> C1 gets 1, 3, 5, 7, 9, 8
> C2 gets 2, 4, 6, (B1 failed), 10
>
> As seen above, I fail B1. P1 and C2 failover to B2. But now the strange
> things happen. C1 starts to get messages out of order. Is there a way to
> prevent this? How can I ensure that in case of broker failure, after
> failover has occurred, consumers will receive messages in order.
>
> To be specific, how can I assure that msg # 8 is processed before message #
> 9 & 10?
There is currently no way on the broker side to preserve message order
with multiple brokers.
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder
Re: How to preserve order of messages in Network of Brokers?
Posted by Roger Hoover <ro...@gmail.com>.
This might help.
http://activemq.apache.org/total-ordering.html
http://activemq.apache.org/per-destination-policies.html
On Sun, May 3, 2009 at 11:29 AM, riteshtijoriwala <
riteshtijoriwala@yahoo.com> wrote:
>
> Just an FYI, I am seeing this behavior with one producer, one consumer and
> two brokers.
>
>
> riteshtijoriwala wrote:
> >
> > I have two consumers C1 and C2 and two brokers B1 and B2 that see each
> > other. I have one producer P1.
> >
> > P1 is connected initially to B1 and C2 is connected to B1. C1 is
> connected
> > to B2. The initial start is as follows:
> >
> > P1 produces 1, 2, 3, 4, 5, 6, (B1 failed), 7, 8, 9, 10.
> > C1 gets 1, 3, 5, 7, 9, 8
> > C2 gets 2, 4, 6, (B1 failed), 10
> >
> > As seen above, I fail B1. P1 and C2 failover to B2. But now the strange
> > things happen. C1 starts to get messages out of order. Is there a way to
> > prevent this? How can I ensure that in case of broker failure, after
> > failover has occurred, consumers will receive messages in order.
> >
> > To be specific, how can I assure that msg # 8 is processed before message
> > # 9 & 10?
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-to-preserve-order-of-messages-in-Network-of-Brokers--tp23353328p23358383.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
Re: How to preserve order of messages in Network of Brokers?
Posted by riteshtijoriwala <ri...@yahoo.com>.
Just an FYI, I am seeing this behavior with one producer, one consumer and
two brokers.
riteshtijoriwala wrote:
>
> I have two consumers C1 and C2 and two brokers B1 and B2 that see each
> other. I have one producer P1.
>
> P1 is connected initially to B1 and C2 is connected to B1. C1 is connected
> to B2. The initial start is as follows:
>
> P1 produces 1, 2, 3, 4, 5, 6, (B1 failed), 7, 8, 9, 10.
> C1 gets 1, 3, 5, 7, 9, 8
> C2 gets 2, 4, 6, (B1 failed), 10
>
> As seen above, I fail B1. P1 and C2 failover to B2. But now the strange
> things happen. C1 starts to get messages out of order. Is there a way to
> prevent this? How can I ensure that in case of broker failure, after
> failover has occurred, consumers will receive messages in order.
>
> To be specific, how can I assure that msg # 8 is processed before message
> # 9 & 10?
>
>
>
--
View this message in context: http://www.nabble.com/How-to-preserve-order-of-messages-in-Network-of-Brokers--tp23353328p23358383.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.