activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Exclusive consumer question
Date Thu, 08 Jun 2006 18:10:20 GMT
On 6/8/06, Hiram Chirino <hiram@hiramchirino.com> wrote:
> On 6/7/06, Richard Taylor <RicharTa@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/

Mime
View raw message