On 09/23/2011 07:44 PM, Praveen M wrote:
Hi,

I'm trying to write a simple test to use the priority queues.

I have a couple of questions.

Can I create priority queues on the fly at run-time?

if I use session.createQueue("queueName  ;{create: always , node : {type :
queue, durable : true, priority : true}}"); will the queue be created as a
priority queue?

The correct syntax uses an extension in the queue creation:

queueName;{create:always, node:{type:queue, x-declare:{arguments:{'x-qpid-priorities':2}}}}

The argument specifies how many distinct priorities are supported by the queue.

Please note that the broker (as required by the AMQP specification) divides the space from 0 to 9 evenly into priority groups depending on how many you ask for. For example, if you specify two levels, priorities 0-4 are equivalent and 5-9 are equivalent with 5-9 being the higher priority.

I hope this helps.

-Ted


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to