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?
Without acknowledgements, message loss is possible during publish and consume operations and only at most once delivery is guaranteed.
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).
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.
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.
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).
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