On 04/04/2015 07:09 PM, Kevin Burton wrote:
> I’m trying to generate unique message IDs so that I can idempotently
> produce messages from our ‘loader’ so that items don’t get processed more
> than once.
>
> The JMS Message ID should do that .. but it looks like when I call
> producer.send() it’s ALWAYs overwritten by a custom message ID:
>
>
> In ActiveMQSession.send it just overwrites it:
>
> msg.setMessageId(new MessageId(producer.getProducerInfo().getProducerId(),
> sequenceNumber));
>
> … so no matter WHAT I want to send , it’s just overwritten.
>
> I’m really hoping I’m doing something or that this is just a bug because it
> would be a shame to lose this feature.
>
This is working as it should, from the spec on setJMSMessageID:
JMS providers set this field when a message is sent. This method can be
used to change the value for a message that has been received.
You can use message properties so define a key / value pair that
represents the application specific message identifier you want to use,
the JMS Message ID value is provider specific.
--
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.redhat.com
twitter: @tabish121
blog: http://timbish.blogspot.com/
|