activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sanjiv Jivan" <sanjiv.ji...@gmail.com>
Subject Re: detaching message group affinity
Date Tue, 20 Jun 2006 18:23:54 GMT
On 6/20/06, James Strachan <james.strachan@gmail.com> wrote:
>
> On 6/20/06, Thomas Swindells <tswindells@ndsuk.com> wrote:
> > James.Strachan wrote:
> > >
> > > On 6/19/06, Sanjiv Jivan <sanjiv.jivan@gmail.com> wrote:
> > >> > 2. Is there a way to detach a message group affinity to a
> particular
> > >> broker.
> > >>
> > >> >Just set JMSXGroupSeq to zero on the last message which 'closes' the
> > >> >message group so if another message is sent in the future with the
> > >> >same group ID it will be reassigned to a new consumer.
> > >>
> > >> >message.setIntProperty("JMSXGroupSeq", 0);
> > >>
> > >> This would reset all the affinity of all the message groups, right?
> > >
> > > No - just the message group for the JMSXGroupId setting.
> > > I should have been more clear... to clear message group FOO use
> > >
> > > message.setStringProperty("JMSXGroupID", "FOO");
> > > message.setIntProperty("JMSXGroupSeq", 0);
> > >
> > Reading the Message group page
> > (http://activemq.org/site/message-groups.html) there is probably a minor
> bug
> > here in that it would close all messsage groups with the same Hash as
> "FOO",
> > although in practice for a well designed system expecting that msg
> groups
> > could change this shouldn't be a problem. Of course the chances of a
> hash
> > clash for relatively short group id's is pretty tiny.
>
> Yeah - hashing collisions should be fairly unlikely - though its a RAM
> v risk tradeoff - the larger the number of hash buckets, the more RAM
> used but the less likely a collision.
>
> Though worse case a message group is closed and reopened - which just
> rebalances the association of message groups to consumers so it
> doesn't cause much harm (*).


This would cause harm if a message group is used as a basis of a stateful
conversation with the chosen server (which embeds a broker)which I how I
require to use them in my usecase. Is not like a stateless stock quote
request which any server can respond to.. its more like
startConversation(A), getResults(A) and if getResults(A) goes to the wrong
server, its an error condition since the conversation was started with
another server. I do not want to get in the business of state replicating
servers, just want to partition conversation based load based (rather that
individual request based load balancing).

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message