spring-bootrabbitmqspring-amqprecovery

How to automatically restore Exchanges in Rabbitmq after it is deleted unexpected


How to automatically restore Exchanges in Rabbitmq after it is deleted unexpected(from client). I'm using spring amqp in my project, but i don't know how to active this feature, i can't even catch a exception when the Exchange disappear. So is there any way to do this? Thx.


Solution

  • I would disable delete permission for clients of the broker since removal of that exchange is not your logic, but you definitely can try to use Broker Events to catch such a change and react to it respectively via RabbitAdmin API: https://docs.spring.io/spring-amqp/docs/current/reference/html/#broker-events