Publish message with max priority is not working as expected

66 views
Skip to first unread message

venkatesh N

unread,
Oct 10, 2022, 10:57:19 PM10/10/22
to rabbitmq-users
Hi Team,

Case 1:
We have tested below test case in RabbitMQ server 3.9
Step 1:  While creating queue ,we declared x-max-priority is 5
Step 2: We published messages with priority=9 ,priority= 5, priority=2 and priority=6 in this order.

Expected behavior after publishing messages: 

Priority order should be: 9  6   5   2

Observed behavior: 9  5   6   2 

Case 2:
Publish message with priority 256 is not throwing any exception.
priority range between 1 to 255 only(It is recommended). It is accepting priority higher than 255 also.
Can you please help us why RabbitMQ server is behaving like this.

Regards,
Venkatesh

Sayed Hadi Rastgou Haghi

unread,
Oct 11, 2022, 2:16:59 AM10/11/22
to rabbitm...@googlegroups.com
Dear Venkatesh,

Hi,

As rabbit priority doc says, messages without a priority property are treated as if their priority were 0. Messages with a priority which is higher than the queue's maximum are treated as if they were published with the maximum priority.
Case 1:
So priorities  9  5  6 are treated as same priority (5). and  consumed in the same order you published  and as expected ( 9 5 2 6 --> 9 5 6 2 ) 

Case 2:
They are all expected as your queues max-priority property.


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/e2e4b8fb-993d-4602-9131-70a03cafbcf4n%40googlegroups.com.


--
Sincerely,

Sayed Hadi Rastgou Haghi
Reply all
Reply to author
Forward
0 new messages