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: Feature Request: Header to indicate that an exclusive consumer or message group has failed over
Date Fri, 07 Jul 2006 17:25:14 GMT
On 7/6/06, James Strachan <james.strachan@gmail.com> wrote:
> On 7/6/06, Jamie McCrindle <jamiemccrindle@gmail.com> wrote:
> > hi,
> >
> > we're using an exclusive consumer to do some high level duplicate
> > checking and it would be really handy to have a header in the first
> > message that's delivered to a consumer when the broker fails over to
> > it so that it can do things like refresh it's cache etc.
>
> Great idea!
>
> I've raised a JIRA to track this - will see if I can get this
> implemented real soon...
> https://issues.apache.org/activemq/browse/AMQ-798

I've not had chance to write a test case yet (bad James!) but I've
just committed a fix for this.

So the boolean property "JMSXGroupFirstForConsumer" will be set on the
first message which is sent to a consumer for a particular message
group.

If the JMS connection is using failover: and a temporary network error
occurs, a new consumer instance will be created under the covers of
the JMS client leading to the possibility of another message with this
header being set for the same message group.

So you can do code like...

String groupId = message.getStringProperty("JMSXGroupId");
if (message.getBooleanProperty("JMSXGroupFirstForConsumer")) {
   // flush cache for groupId
}

for more background see: http://activemq.org/site/message-groups.html

-- 

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

Mime
View raw message