gorabbitmq

Are RabbitMQ messages lost if published to an exchange with a specific routing key when the consumer queue doesn't exist yet?


When I publish a message to RabbitMQ, is the message sent to the exchange with a specific routing key, and when the consumer queue doesn't exist yet, will the message be lost?


Solution

  • Yes, RabbitMQ will drop the message.

    But, you care about your data, so you're using publisher confirmations, correct? If so, RabbitMQ will send a message back indicating that your message was not routed.

    You can also specify an alternate exchange to catch these messages.