You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Richard Taylor <Ri...@attachmatewrq.com> on 2006/06/08 02:50:28 UTC

Exclusive consumer question

Hi Gang,

 

Our group is working on a clustering solution in which we're using
ActiveMQ for our messaging.  We have a group of "nodes" clustered
together, all communicating via predetermined JMS Queues / Topics, using
a network of brokers under the covers. 

 

At any given time, one node is the "coordinator" and I'm looking for a
way for nodes to send messages to the current coordinator regardless of
who it currently is.  Which node is the coordinator is determined by
another service.   I've been thinking of having one "coordinator" queue
and have been trying to determine the best way to route messages to the
current coordinator node.  

 

Possible solutions include:

- Have a per-node "Coordinator Queue" and a MessageConsumer that runs
only on the coordinator node, forwarding messages from the cluster wide
Coordinator Queue to the local node's queue. 

- Write a custom MessageConsumer to be run on nodes that is aware of
whether or not the local node is the coordinator and either processes
messages or not depending on its state.

- Use the Exclusive Consumer feature of ActiveMQ 4.x to determine the
coordinator, having each node simply be an exclusive consumer.  This
would seemingly work, although we lose control over who the coordinator
node is I believe.

 

Questions:

- Any of the solutions above stick out as the most/least appropriate?

- If we used the Exclusive Consumer feature in ActiveMQ:

      - what determines who currently is the consumer?

      - what exactly determines when the consumer changes?  

      - and is there any way to get notified of a change in that
consumer (assuming the node that just lost that status is alive).

 

Thank you!


Re: Exclusive consumer question

Posted by James Strachan <ja...@gmail.com>.
On 6/8/06, Hiram Chirino <hi...@hiramchirino.com> wrote:
> On 6/7/06, Richard Taylor <Ri...@attachmatewrq.com> wrote:
> > Hi Gang,
> >
> >
> >
> > Our group is working on a clustering solution in which we're using
> > ActiveMQ for our messaging.  We have a group of "nodes" clustered
> > together, all communicating via predetermined JMS Queues / Topics, using
> > a network of brokers under the covers.
> >
> >
> >
> > At any given time, one node is the "coordinator" and I'm looking for a
> > way for nodes to send messages to the current coordinator regardless of
> > who it currently is.  Which node is the coordinator is determined by
> > another service.   I've been thinking of having one "coordinator" queue
> > and have been trying to determine the best way to route messages to the
> > current coordinator node.
> >
> >
> >
> > Possible solutions include:
> >
> > - Have a per-node "Coordinator Queue" and a MessageConsumer that runs
> > only on the coordinator node, forwarding messages from the cluster wide
> > Coordinator Queue to the local node's queue.
> >
> > - Write a custom MessageConsumer to be run on nodes that is aware of
> > whether or not the local node is the coordinator and either processes
> > messages or not depending on its state.
> >
> > - Use the Exclusive Consumer feature of ActiveMQ 4.x to determine the
> > coordinator, having each node simply be an exclusive consumer.  This
> > would seemingly work, although we lose control over who the coordinator
> > node is I believe.
> >
> >
> >
> > Questions:
> >
> > - Any of the solutions above stick out as the most/least appropriate?
> >
> > - If we used the Exclusive Consumer feature in ActiveMQ:
> >
> >       - what determines who currently is the consumer?
>
> The first exclusive consumer to register with the broker wins being
> the active consumer.
>
> >
> >       - what exactly determines when the consumer changes?
> >
>
> When the active consumer dies, the next exclusive consumer is made the
> active consumer.
>
> >       - and is there any way to get notified of a change in that
> > consumer (assuming the node that just lost that status is alive).

The node that was alive should typically find their connection closed
on them pretty soon around the time the ownership changes. And the new
owner will receive a message - its first - as an indicator that its
now the new owner; so I guess the client side could deduce the change
of ownership.

Though maybe when exclusive consumer changes - or message group owner
changes - we could add some flag to the message to make it completely
obvious that the consumer is the new owner
-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Exclusive consumer question

Posted by Hiram Chirino <hi...@hiramchirino.com>.
On 6/7/06, Richard Taylor <Ri...@attachmatewrq.com> wrote:
> Hi Gang,
>
>
>
> Our group is working on a clustering solution in which we're using
> ActiveMQ for our messaging.  We have a group of "nodes" clustered
> together, all communicating via predetermined JMS Queues / Topics, using
> a network of brokers under the covers.
>
>
>
> At any given time, one node is the "coordinator" and I'm looking for a
> way for nodes to send messages to the current coordinator regardless of
> who it currently is.  Which node is the coordinator is determined by
> another service.   I've been thinking of having one "coordinator" queue
> and have been trying to determine the best way to route messages to the
> current coordinator node.
>
>
>
> Possible solutions include:
>
> - Have a per-node "Coordinator Queue" and a MessageConsumer that runs
> only on the coordinator node, forwarding messages from the cluster wide
> Coordinator Queue to the local node's queue.
>
> - Write a custom MessageConsumer to be run on nodes that is aware of
> whether or not the local node is the coordinator and either processes
> messages or not depending on its state.
>
> - Use the Exclusive Consumer feature of ActiveMQ 4.x to determine the
> coordinator, having each node simply be an exclusive consumer.  This
> would seemingly work, although we lose control over who the coordinator
> node is I believe.
>
>
>
> Questions:
>
> - Any of the solutions above stick out as the most/least appropriate?
>
> - If we used the Exclusive Consumer feature in ActiveMQ:
>
>       - what determines who currently is the consumer?

The first exclusive consumer to register with the broker wins being
the active consumer.

>
>       - what exactly determines when the consumer changes?
>

When the active consumer dies, the next exclusive consumer is made the
active consumer.

>       - and is there any way to get notified of a change in that
> consumer (assuming the node that just lost that status is alive).
>

Not yet.  But it's a good idea for a new feature.  Please submit a
request for this feature at our JIRA:
http://issues.apache.org/activemq/browse/AMQ

>
>
> Thank you!
>
>
>


-- 
Regards,
Hiram