Oh .. meaning I would have to build the unique handling in my application? Well I was looking at improving functionality in the memory store so maybe I could implement this there directly. Maybe add a new feature for changing the primary key used in the backing. This way message with a JMSKey header (or something along those lines) can override the PK used which is normally the MessageId.
I guess I could work around something here but it’s way easier to let ActiveMQ do it.. it’s a shame it can’t do it out of the box. Maybe a feature for 6.0. I imagine I could implement some sort of secondary plugin to handle this but it seems easier to just allow ActiveMQ to do it natively. On Sat, Apr 4, 2015 at 5:22 PM, Timothy Bish <tabish...@gmail.com> wrote: > On 04/04/2015 08:16 PM, Kevin Burton wrote: > > 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 <tabish...@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.b...@redhat.com | www.redhat.com > >> twitter: @tabish121 > >> blog: http://timbish.blogspot.com/ > >> > >> > > > I was referring to standard JMS Message properties which you application > could leverage: > > e.g message.setStringProperty("myMessageId", "MyUniqueValue") > > Inside the broker the message ID is always the standard > producerId:sequenceId value and I don't recommend abusing it as there is > a lot of broker code that is expecting this design. > > -- > Tim Bish > Sr Software Engineer | RedHat Inc. > tim.b...@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>