简体   繁体   中英

RabbitMQ queue count based on message header value

I am exploring the option of getting the queue count based on the custom header value in the message. For ex, If I have a queue that has 100 messages - 25 with a custom header "CUSTHDR" and value = "Apple", 25 with header value "Orange" and another 50 with header value "Grapes", I need to be able to get the count of messages in the queue based on the header value. Something like a method that returns 50 when I run GetMessageCount("Grapes");

Any direction is greatly appreciated.

This is not supported by RabbitMQ.

You would have to consume all messages, group them by header to get counts, and then re-enqueue them (or reject the deliveries).


the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow. RabbitMQ团队监视rabbitmq-users 邮件列表 ,仅在某些情况下回答关于StackOverflow的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM