I was planning to use RabbitMQ for a project in which I require to know position of my task after every few second in the queue.
Say I am using it for generating reports and if there is a Queue then I would want to show the user his position in the queue before the task actually starts.
Is this something I can achieve through RabbitMQ??
It is not possible to get message position in queue in RabbitMQ. In fact, it is something not related to AMQP protocol at all.
As a workaround to achieve what you want, you may add message id to some storage on publish, say MySQL database and then remove it from there when consumed. Then you can query that data to get metrics you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With