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 Mon, 19 Jun 2006 16:29:39 GMT
On 6/19/06, James Strachan <james.strachan@gmail.com> wrote:
>
> On 6/19/06, Sanjiv Jivan <sanjiv.jivan@gmail.com> wrote:
> > On 6/19/06, James Strachan <james.strachan@gmail.com> wrote:
> > >
> > >
> > > > Who is the owner of the "JMSXGroupID" to broker mapping? Is it the
> JMS
> > > > Connection or a JMSSession? I need to send messages by different
> Message
> > > > Groups from the same client application. I would like to understand
> if I
> > > > need to create separate JMS Connections for each message group based
> > > > conversation, or separate JMS Sessions would suffice. A quick look
> at
> > > the
> > > > source seems to indicate that Message Groups are held at the JMS
> > > connection
> > > > level (ActiveMQConnectionMetaData). Can you confirm?
> > >
> > > A broker manages Message Groups for its consumers. Its nothing to do
> > > with connections per se - its purely a mapping of JMSXGroupID to
> > > message consumer in a broker.
> >
> >
> > A consumer being the value in JMSReplyTo?
>
> Not necessarily - a consumer being some POJO created via
> Session.createMessageConsumer().
>
> But if the consumers are using temporary queues/topics then they are
> nearly the same thing.
>
>
> > I guess what I'm having difficulty
> > understanding is where is the correlation between a single message with
> "
> > message.setIntProperty("JMSXGroupSeq", 0);" to MessageGroupID being
> made. Is
> > it based on JMSReplyTo value provided by the producer sending the
> message?
>
>
> If someone is sending a message and they want to 'close' a message
> group, they set the JMSXGroupSeq header along with the JMSXGroupID
> header.


aha, this was the thing I was missing. ie JMSXGroupID *and* JMSXGroupSeq
should be send in the same message for it to detach the message group
affinity for the specified JMSXGroupID.

If some other node who is not a JMS sender wants to close a message
> group, you could always just send a dummy message.
>
>
> > What is the expected behaviour in such a scenario (this is related to
> issue
> > AMQ-760): A network of 2 brokers has been set up. A client sends several
> > messages to MG1 and MG2 which are received by SERVER1 and SERVER2
> > respectively. The client process terminates (ie the JMSConenction,
> > session etc are destroyed). The client comes up an send messages to MG1
> and
> > MG2. Is is guaranteed that MG1 and MG2 go to the designated servers from
> the
> > previous run (SERVER1 and SERVER2 respectively).
>
> Message groups is a broker-side thing; the only thing which affects
> which consumer is associated with a message group is
>
> * when the consumer is closed (e.g. as a result of a Connection
> close), its message groups are put back in the pool to be re-assigned
> to a consumer


This is extremely useful to know. Maybe you can add this info too on the
ActiveMQ web site.

* if the message group is explicitly closed by a message containing a
> JMSXGroupId and a JMSXGroupSeq of value 0
>
> --


With this info I now have a better understanding of how things work and have
a bunch of things that I can try. Will report back with results/ further
questions.

I realize you guys are very busy so thanks so much for being patient and
answering my questions in detail.

Sanjiv

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