You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Roger Hoover <ro...@gmail.com> on 2008/02/26 07:49:47 UTC

Ordering of persistent/non-persistent messages in ActiveMQ 5

Using STOMP on AMQ 5, if I enqueue some persistent and non-persistent
messages and then consume them, they don't get consumed in the order in
which they were produced.  The non-persistent messages are delivered first
(with their relative order preserved) followed by the persistent messages
(also with their relative order preserved).

AMQ 4 preserved message order regardless of persistence settings.

Is this expected behavior?  Is it controlled by any configuration?

Thanks,

Roger

Re: Ordering of persistent/non-persistent messages in ActiveMQ 5

Posted by Jim Gomes <e....@gmail.com>.
Hi Rob,

Is this the same thing as the Total Ordering feature (c.f.,
http://activemq.apache.org/total-ordering.html), or is it something
different?  While it may be expected behavior, it was a little surprising to
read that was what would happen.

Best,
Jim

On Tue, Feb 26, 2008 at 12:06 AM, Rob Davies <ra...@gmail.com> wrote:

>
> On 26 Feb 2008, at 06:49, Roger Hoover wrote:
>
> > Using STOMP on AMQ 5, if I enqueue some persistent and non-persistent
> > messages and then consume them, they don't get consumed in the order
> > in
> > which they were produced.  The non-persistent messages are delivered
> > first
> > (with their relative order preserved) followed by the persistent
> > messages
> > (also with their relative order preserved).
> >
> > AMQ 4 preserved message order regardless of persistence settings.
> >
> > Is this expected behavior?  Is it controlled by any configuration?
> >
> > Thanks,
> >
> > Roger
>
> This is expected behaviour - as persistent/non-persistent messages
> have different qualities of service and take different paths through
> the broker
>
>

Re: Ordering of persistent/non-persistent messages in ActiveMQ 5

Posted by Rob Davies <ra...@gmail.com>.
On 26 Feb 2008, at 06:49, Roger Hoover wrote:

> Using STOMP on AMQ 5, if I enqueue some persistent and non-persistent
> messages and then consume them, they don't get consumed in the order  
> in
> which they were produced.  The non-persistent messages are delivered  
> first
> (with their relative order preserved) followed by the persistent  
> messages
> (also with their relative order preserved).
>
> AMQ 4 preserved message order regardless of persistence settings.
>
> Is this expected behavior?  Is it controlled by any configuration?
>
> Thanks,
>
> Roger

This is expected behaviour - as persistent/non-persistent messages  
have different qualities of service and take different paths through  
the broker


Re: Ordering of persistent/non-persistent messages in ActiveMQ 5

Posted by Roger Hoover <ro...@gmail.com>.
It's a good point.  I can't think of an application that would do it on
purpose. A bug in the producer might be the only scenario where it could
cause problems.

I was just running some tests while preparing to upgrade to AMQ5 and wanted
to be clear on this.

On Tue, Feb 26, 2008 at 9:44 AM, Ben Chobot <bc...@vigilos.com> wrote:

> Certainly, but if order matters, wouldn't you expect to get all or none
> of your messages that depend upon each other? Why would you send x as
> non-persistent and x+1 as persistent if x+1 requires x to be processed?
>
> Roger Hoover wrote:
> > There are applications in which message order matters and you generally
> > wouldn't expect message properties to affect the order of delivery
> unless
> > you're using a selector.
> >
> > On Tue, Feb 26, 2008 at 8:59 AM, Ben Chobot <bc...@vigilos.com> wrote:
> >
> >
> >> Why wouldn't you want it to be this way?
> >>
> >> Roger Hoover wrote:
> >>
> >>> Using STOMP on AMQ 5, if I enqueue some persistent and non-persistent
> >>> messages and then consume them, they don't get consumed in the order
> in
> >>> which they were produced.  The non-persistent messages are delivered
> >>>
> >> first
> >>
> >>> (with their relative order preserved) followed by the persistent
> >>>
> >> messages
> >>
> >>> (also with their relative order preserved).
> >>>
> >>> AMQ 4 preserved message order regardless of persistence settings.
> >>>
> >>> Is this expected behavior?  Is it controlled by any configuration?
> >>>
> >>> Thanks,
> >>>
> >>> Roger
> >>>
> >>>
> >>>
> >>
> >
> >
>
>

Re: Ordering of persistent/non-persistent messages in ActiveMQ 5

Posted by Ben Chobot <bc...@vigilos.com>.
Certainly, but if order matters, wouldn't you expect to get all or none 
of your messages that depend upon each other? Why would you send x as 
non-persistent and x+1 as persistent if x+1 requires x to be processed?

Roger Hoover wrote:
> There are applications in which message order matters and you generally
> wouldn't expect message properties to affect the order of delivery unless
> you're using a selector.
>
> On Tue, Feb 26, 2008 at 8:59 AM, Ben Chobot <bc...@vigilos.com> wrote:
>
>   
>> Why wouldn't you want it to be this way?
>>
>> Roger Hoover wrote:
>>     
>>> Using STOMP on AMQ 5, if I enqueue some persistent and non-persistent
>>> messages and then consume them, they don't get consumed in the order in
>>> which they were produced.  The non-persistent messages are delivered
>>>       
>> first
>>     
>>> (with their relative order preserved) followed by the persistent
>>>       
>> messages
>>     
>>> (also with their relative order preserved).
>>>
>>> AMQ 4 preserved message order regardless of persistence settings.
>>>
>>> Is this expected behavior?  Is it controlled by any configuration?
>>>
>>> Thanks,
>>>
>>> Roger
>>>
>>>
>>>       
>>     
>
>   


Re: Ordering of persistent/non-persistent messages in ActiveMQ 5

Posted by Roger Hoover <ro...@gmail.com>.
There are applications in which message order matters and you generally
wouldn't expect message properties to affect the order of delivery unless
you're using a selector.

On Tue, Feb 26, 2008 at 8:59 AM, Ben Chobot <bc...@vigilos.com> wrote:

> Why wouldn't you want it to be this way?
>
> Roger Hoover wrote:
> > Using STOMP on AMQ 5, if I enqueue some persistent and non-persistent
> > messages and then consume them, they don't get consumed in the order in
> > which they were produced.  The non-persistent messages are delivered
> first
> > (with their relative order preserved) followed by the persistent
> messages
> > (also with their relative order preserved).
> >
> > AMQ 4 preserved message order regardless of persistence settings.
> >
> > Is this expected behavior?  Is it controlled by any configuration?
> >
> > Thanks,
> >
> > Roger
> >
> >
>
>

Re: Ordering of persistent/non-persistent messages in ActiveMQ 5

Posted by Ben Chobot <bc...@vigilos.com>.
Why wouldn't you want it to be this way?

Roger Hoover wrote:
> Using STOMP on AMQ 5, if I enqueue some persistent and non-persistent
> messages and then consume them, they don't get consumed in the order in
> which they were produced.  The non-persistent messages are delivered first
> (with their relative order preserved) followed by the persistent messages
> (also with their relative order preserved).
>
> AMQ 4 preserved message order regardless of persistence settings.
>
> Is this expected behavior?  Is it controlled by any configuration?
>
> Thanks,
>
> Roger
>
>