How to see RabbitMQ messages

5.2k Views Asked by At

Can't view rabbitmq queue messages after using the get messages command.

rabbitmqadmin get queue='queue_name' -H localhost -P 15672 -u rmq -p rmq --vhost=/ count=100

Queue count shows 100 messages, cant use the above command again to see the messages.

2

There are 2 best solutions below

1
On

I would suggest to read https://www.rabbitmq.com/getstarted.html to understand how rabbitmq works.

The command get consumes the messages so you can't consume them anymore.

If you want to consume the same messages multi-times you can use the stream queue type.

1
On

When rabbitMq consumer consumes a mensagem from a queue the same will be deleted from the queue. If you just want to see the message you can log to the RabbitMQ Managment and read the messages, if they're not serialized. But if you want to consume the same message for some reason multiple times read the part of streams queue on the documentation.