qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Goldstein <andy.goldst...@redhat.com>
Subject Re: C++ broker and priority queues
Date Fri, 01 Mar 2013 14:26:56 GMT

On Mar 1, 2013, at 9:24 AM, Aleš Trček wrote:

> Ooops, my first posting, and I have already made a fool of myself... :)
> Yes, the priorities work fine, I thought that lower numbers are higher priorities when
actually it is the opposite... That and not checking properly the output I got.
> So, for the reference, both:
> $ qpid-config add queue testqueue --argument=qpid.priorities=10
> and:
> $ qpid-config add queue testqueue --argument=x-qpid-priorities=10
> work in qpid C++ 0.18. Now I just wish it would be better documented (or at all :)),
it also wouldn't hurt if qpid-stat would have an extra column denoting priority queue (like
it is for durable and other types).

If it helps any, "qpid-config queues" will show that information.

> 
> Thanx to all for your help.
> 
> Regards,
> Ales
> 
>> 
>>> -----Original Message-----
>>> From: Pavel Moravec [mailto:pmoravec@redhat.com] 
>>> Sent: Friday, March 01, 2013 1:23 PM
>>> To: users@qpid.apache.org
>>> Subject: Re: C++ broker and priority queues
>>> 
>>> Hi all,
>>> what worked everytime for me (and does so even on 0.18):
>>> 
>>> qpid-config add queue test --argument=x-qpid-priorities=10
>>> 
>>> # let test it using qpid-send, add property "prio" to see the ordering
>>> 
>>> qpid-send -m 1 -a test --priority 2 -P prio=two qpid-send -m 1 -a test --priority
1 -P prio=one qpid-send -m 1 -a test --priority 3 -P prio=three
>>> 
>>> # read the messages by _browsing_ the queue - messages are printed in FIFO order,
that is correct (discussed here ~2 years ago)
>>> 
>>> qpid-receive -m 3 -a "test; {mode:browse}" --print-headers=yes | grep prio
>>> Properties: {prio:two, sn:1, ts:1362136552849962388, x-amqp-0-10.routing-key:test}
>>> Properties: {prio:one, sn:1, ts:1362136559340302340, x-amqp-0-10.routing-key:test}
>>> Properties: {prio:three, sn:1, ts:1362136563996705690, x-amqp-0-10.routing-key:test}
>>> 
>>> # consume the messages - will follow priorities now properly
>>> 
>>> qpid-receive -m 3 -a "test" --print-headers=yes | grep prio
>>> Properties: {prio:three, sn:1, ts:1362136563996705690, x-amqp-0-10.routing-key:test}
>>> Properties: {prio:two, sn:1, ts:1362136552849962388, x-amqp-0-10.routing-key:test}
>>> Properties: {prio:one, sn:1, ts:1362136559340302340, x-amqp-0-10.routing-key:test}
>>> 
>>> 
>>> Hope it helps,
>>> 
>>> Zdravím krajany (greetings to compatriots), Pavel Moravec
>>> 
>>> 
>>> ----- Original Message -----
>>>> From: "Aleš Trček" <Ales.Trcek@halcom.si>
>>>> To: users@qpid.apache.org
>>>> Sent: Friday, March 1, 2013 12:46:47 PM
>>>> Subject: RE: C++ broker and priority queues
>>>> 
>>> The prefetch buffer was set to 1, but this is irrelevant for my test, 
>>> which is as follows:
>>> -create queue with --argument=qpid.priorities=10 -put a few messages 
>>> with prio 6 to the queue (messageProducer.send(message, 
>>> DeliveryMode.PERSISTENT, 6, 0);) -put a few messages with prio 3 -put 
>>> a few messages with prio 4 -check queue stats with qpid-stat - 
>>> messages are in the queue -run receive test, which gets messages one 
>>> by one - first I get messages with prio 6, then 3, then 4, just the 
>>> way I had sent them in (as said, I can see that priorities do get set 
>>> by calling message.getJMSPriority()).
>>> [Actions are run one by one, so there should be no problems with 
>>> session / connection.]
>>> 
>>> Therefore I assume that queue is still FIFO and not a priority queue.
>>> Did someone try this and made it work? :)
>>> 
>>> Regards,
>>> Ales
>>> 
>>> -----Original Message-----
>>> From: Robbie Gemmell [mailto:robbie.gemmell@gmail.com]
>>> Sent: Thursday, February 28, 2013 7:51 PM
>>> To: users@qpid.apache.org
>>> Subject: RE: C++ broker and priority queues
>>> 
>>> Are you sure the queue isn't a priority queue? What is the message 
>>> activity you are using to determine this?
>>> 
>>> Depending on the nature of your test, it is possible you are simply 
>>> seeing the result of the clients message prefetch buffer (defaults to 
>>> 500msg) if you haven't adjusted it. You should use a lower prefetch 
>>> value with a priority queue if the ordering is of most importance to 
>>> you. See 
>>> http://qpid.apache.org/books/trunk/AMQP-Messaging-Broker-Java-Book/htm
>>> l/Java-Broker-Queues-OtherTypes.html#Java-Broker-Queues-OtherTypes-Set
>>> LowPrefetchfor
>>> more details.
>>> 
>>> Robbie
>>> On 28 Feb 2013 10:17, "Aleš Trček" <Ales.Trcek@halcom.si> wrote:
>>> 
>>>> Thanks for the suggestion, however this does not seem to work.
>>>> Queue
>>>> is created, messages can be exchanged, but I receive them FIFO not 
>>>> sorted by priority. With message.getJMSPriority() I can see the 
>>>> priorities I had set, so that is OK. It's just that the queue is not 
>>>> a priority queue. Any other insights into this priority stuff on C++ 
>>>> broker? :)
>>>> 
>>>>> Hi Aleš,
>>>>> 
>>>>> I think you can use the --argument=<NAME=VALUE> option of the 
>>>>> qpid-config
>>>> to specify the number of priorities. It is a long time since I used 
>>>> it, but I believe it should >be something like ...
>>>>> --argument=qpid.priorities=10
>>>>> ... to specify that you want the queue to distinguish 10 priority 
>>>>> levels.
>>>>> 
>>>>> I'm not sure why the priority queues seem to be missing in the Qpid
>>>> documentation - Red Hat MRG-M documentation seems to contain some 
>>>> more details about it (> 
>>>> https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_MR
>>>> G/ 2/html/Messaging_Programming_Reference/sect-Priority_Queuing.html
>>>> ).
>>>>> I'm not sure whether this means that the functionality has been 
>>>>> removed
>>>> since 0.14.
>>>>> 
>>>>> Regards
>>>>> Jakub
>>>>> 
>>>>> On Wed, Feb 27, 2013 at 4:46 PM, Aleš Trček <Ales.Trcek@halcom.si>
>>>>> wrote:
>>>>> 
>>>>>> re is no trace of priority queues. How can I create one, or i
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
>>> additional commands, e-mail: users-help@qpid.apache.org
>>> 
>>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message