On 7/6/06, James Strachan <[EMAIL PROTECTED]> wrote:
On 7/6/06, Jamie McCrindle <[EMAIL PROTECTED]> 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/