activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Burton <bur...@spinn3r.com>
Subject Re: JMS message ID set based on sequence and overwrites the client specified JMS message id?
Date Sun, 05 Apr 2015 00:16:55 GMT
I was hoping it was the Message ID because the memory store’s message table
is by message ID so re-producing messages with the same messages IDs would
use the same key so would only be stored in memory once.

In theory this is possible but the ActiveMQ internals assert the
producer+sequence design.

I guess I could get clever and do something silly and abuse producer IDs to
get some internal efficiency from ActiveMQ but that might lead to unknown
bugs.

Where is the documentation of setting up a unique message ID header?  I
haven’t been able to find anything on the subject.

On Sat, Apr 4, 2015 at 5:00 PM, Timothy Bish <tabish121@gmail.com> wrote:

> 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/
>
>


-- 

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>
<http://spinn3r.com>

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