A
A
Alexander2016-10-10 13:28:56
PHP
Alexander, 2016-10-10 13:28:56

RabbitMQ: How to keep a message in a queue?

Good day! There is a need to implement messaging using RabbitMQ, using the "topic" type. I wrote the code as given in the example on the official website www.rabbitmq.com/tutorials/tutorial-five-php.html , everything works great. But there is one "but", namely, if you send a message at a time when the subscriber is not running, then the messages in the queue do not accumulate, but simply disappear and ultimately do not reach the subscriber, but if the subscriber is active, then the messages are fine reach.
So, how do you get the example code to accumulate messages in the queue?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-10-10
@yarkin

If I understand correctly, then when creating a queue (queue_declare), an empty string is specified as the name, to which RabbitMQ creates a random name for it and adds the exclusive flag, as a result of which the queue is deleted when the connection is closed by the client. Try giving your own name to the queue and see the parameters for calling this method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question