I haven't used JMSXGroupid myself, so everything I say is based on what
I've read, not what I've done.  With that said...

I believe that JMSXGroupid should be respected across the entire network of
brokers (NoB).  When Broker A allocates a given JMSXGroupid to a given
consumer, I believe that it will let Broker B know about that allocation,
so messages with a JMSXGroupid of 1 that are produced to Broker B should be
forwarded to Broker A rather than delivered to a local consumer on B.  So
ActiveMQ should already be able to give you the ability to deliver all of
those messages to a single consumer.

But having every message go to a single consumer isn't the same as having
all messages go to that consumer in the order in which they were
published.  Like I said in my first email, delivery to a single consumer is
in-order **from the perspective of the broker to which it is connected**.
>From Broker A's perspective, a message from Producer 2 on Broker B is
published when the message is published from Broker B to Broker A, not when
it is published from Producer 2 to Broker B.  So all the messages published
directly to Broker A will be in order relative to one another, and all the
messages published to Broker B and then forwarded to Broker A will be in
order relative to one another, but the ordering of the messages in the two
streams relative to one another may not be in the order in which they were
actually produced.

This is both the beauty and the limitation of the ActiveMQ model: the
perspective of any given broker generally spans only that one broker and
the things it can see, but for some features there is no ability to
consider the entire network of brokers.  This is both elegant (because it
allows a simple implementation that still allows you to build arbitrarily
complex networks of brokers) and limiting (because it can be difficult or
impossible to support certain functionality that requires a whole-network
view).

Tim

On Sun, Aug 7, 2016 at 6:54 AM, Dmtiriy <dmitriyc...@gmail.com> wrote:

> I guess what I was trying to ask is that if BrokerA on JVM1 registers a
> consumer on Queue-1 w/ JMSXGroupid of 1, can networked BrokerB on JVM2
> register a different consumer on same Queue-1 w/ same JMSXGroupid of 1.  Do
> networked brokers have a way to preserve single consumer per unique
> JMSXGroupid and therefore order across network brokers?
>
> You kind of answered that question already that order not preserved across
> network brokers even when JMSXGroupid is used and based on my tests with
> multiple consumers per JMSXGroupid (1 consumer per broker per jvm per
> JMSXGroupid)
>
> What is the best approach to preserve message order across embedded
> brokers?
> Is master/slave setup w/ replicated data store a better option in this case
> or some type of distributed queue setup?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Message-Ordering-across-Networked-Brokers-
> tp4715070p4715110.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reply via email to