Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Messages lost if queue does not exist

When we send the messages to RabbitMQ and if queue doesn't exist, messages are lost without throwing any error.

Where the messages will be posted to? Dead queue?

like image 442
rupesh Avatar asked May 25 '17 08:05

rupesh


People also ask

Can RabbitMQ lost messages?

Without acknowledgements, message loss is possible during publish and consume operations and only at most once delivery is guaranteed.

What happens when RabbitMQ queue is full?

The default behaviour for RabbitMQ when a maximum queue length or size is set and the maximum is reached is to drop or dead-letter messages from the front of the queue (i.e. the oldest messages in the queue).

Why RabbitMQ shows activity on message rates but not on queued messages?

convertAndSend was not set properly -- the message was not sent to the correct queue -- the Queued messages was empty all time. however, Message rates is not zero, it does show there are message get sent. Which correspond to what the other answer is saying: In case RabbitMQ receive non-routable message it drop it.

Will a RabbitMQ Requeue message expire?

The original expiry time of a message is preserved if it is requeued (for example due to the use of an AMQP method that features a requeue parameter, or due to a channel closure). Setting the TTL to 0 causes messages to be expired upon reaching a queue unless they can be delivered to a consumer immediately.


1 Answers

That is the way RabbitMQ is designed - publishers publish to exchanges, not queues.

If there is no queue bound (with a matching routing key if the exchange requires one), the message is simply discarded.

You can enable publisher returns and set the mandatory flag when publishing and the broker will return the message (but it arrives on a different thread, not the publishing thread).

like image 72
Gary Russell Avatar answered Oct 21 '22 05:10

Gary Russell