It is interesting... the entire index is in memory, and I noticed a jmx operation that will swap the priority of a message, it just means moving it between priority lists in the in memory index[1]. Ordering would be more expensive by far, but by replacing the priority lists with some sort of ordered list could work. It would be an application specific queue rather than a generic FIFI queue. I wonder if it would make sense to have the list impl plugable[2] for an address. In that way there could be an application specific comparator. It would sort this use case in the most optimal way.
[1] https://github.com/apache/activemq-artemis/blob/b7125d51c318175e1a78b4162aeb0cf24ec18a15/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java#L1889 [2] https://github.com/apache/activemq-artemis/blob/b7125d51c318175e1a78b4162aeb0cf24ec18a15/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java#L165 On Thu, 16 Nov 2017 at 17:20 Justin Bertram <jbert...@redhat.com> wrote: > I responded to your same post over on Stackoverflow [1]. > > In order to avoid confusion it might be best not to post the same question > in multiple places. > > > Justin > > [1] > > https://stackoverflow.com/questions/47333287/re-ordering-of-messages-artemis > > On Thu, Nov 16, 2017 at 6:34 AM, alisu <alisu7...@gmail.com> wrote: > > > In my use case, I have to run two instances of the same application that > > read > > messages from 'queue-1' and write them back to another queue 'queue-2'. > I > > need my messages inside the two queues to be ordered by specific property > > (sequence number) which is initially added to every message by producer. > As > > per documentation, inside queue-1 the order of messages will be preserved > > as > > messages are sent by a single producer. But because of having multiple > > consumers that read, process and send the processed messages to queue-2, > > the > > order of messages inside queue-2 might be lost. So my task is to make > sure > > that messages are delivered to queue-2 in the same order as they were > read > > from queue-1. I have implemented re-sequencer pattern from Apache camel > to > > re-order messages inside queue-2. The re-sequencer works fine but results > > to > > data transfer overhead as the camel routes run locally. Thinking about > > doing > > it in a better way, I have three questions: > > > > 1) Does artemis supports re-ordering of messages inside a queue using a > > property such as sequence number. > > > > 2) Is it possible to run the routes inside the server? If yes, can you > give > > an example or give a link to the documentation? > > > > 3) Some artemis features such as divert (split) requires modifying broker > > configuration (broker.xml file), is there a way to do them > programatically > > and dynamically so I can decide when to start diverting message? I know > > this > > can be accomplished by using camel, but I want everything to be running > in > > the server. > > > > Thanks. > > > > > > > > -- > > Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User- > > f2341805.html > > >