activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SuoNayi <suonayi2...@163.com>
Subject Reply:Re: Reply:Re: Message priority
Date Mon, 07 Jan 2013 13:26:49 GMT
Well,let's explore the message priority mechanism inside the broker.
The message sent from a producer will be persistent in the message store at first,
then it will be cached in the message cursor if the memory for the cursor is available.
That cursor is basically a priority list which supports sorting messages by priority.
When messages in the message cursor are all consumed by consumers the broker will
read the next batch messages by message priority from the store.
So if the space of  the message cursor is very small or disabling the cache capability 
of the message cursor the cursor will not be able to cache messages and the broker 
will always read the next batch messages by message priority from the store.
In this case the broker behaves as your issuing the statement as the following in the database,
SELECT * FROM MESSAGE_TABLE ORDER BY priority.
Of course this approach pays some price on peformance penalty or you can consider 
using different queues to deliver different priority messages.



At 2013-01-07 15:40:13,xawiers <xawiers@gmail.com> wrote:
>According to SuoNayi, amq will respect the message priority order if vmcursor
>is used.
>If I will use default cursor - I will not get message priority. And this is
>bad. Message priority is very important to me.
>I have tried with storage cursor also:
>One producer, one consumer
>
>added 10 messages with priority 3
>added 3 messages with priority 5
>added 100000 messages with priority 3
>added 3 messages with priority 5
>
>consumed 3 messages (all priority 5), consuming 4th message I got message
>with priority 3. Where is my important message ?
>
>
>
>--
>View this message in context: http://activemq.2283324.n4.nabble.com/Message-priority-tp4040260p4661442.html
>Sent from the ActiveMQ - User mailing list archive at Nabble.com.

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