Home  >  Article  >  Backend Development  >  Will a RabbitMQ message be lost if it is published to an exchange with a specific routing key when the consumer queue does not yet exist?

Will a RabbitMQ message be lost if it is published to an exchange with a specific routing key when the consumer queue does not yet exist?

WBOY
WBOYforward
2024-02-06 10:00:031001browse

当消费者队列尚不存在时,如果将 RabbitMQ 消息发布到具有特定路由键的交换器,是否会丢失?

Question content

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


Correct answer


Yes, RabbitMQ will discard the message.

But, you care about your data, so you use Publisher Confirmation a>, right? If so, RabbitMQ will send back a message indicating that your message was not routed.

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

The above is the detailed content of Will a RabbitMQ message be lost if it is published to an exchange with a specific routing key when the consumer queue does not yet exist?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete