简体   繁体   中英

Rabbit MQ fault tolerance

I have a project where we are using Rabbit MQ has message broker, I have below concern, please help on the same.

  1. If Rabbit MQ goes down, how we can retrieve the queued message.is there any configuration in rabbit MQ?
  2. Can we implement same in java thread and collection combination, that can be used as alternative to rabbit MQ? if yes help with an example.
  1. 'You should listen to ShutdownListener callback on both Connection and Channel classes'. By this way, you know if the queue is down. After that, you need to re-transmit your queued messages. This is what official documentations says. https://www.rabbitmq.com/reliability.html

  2. Of course you can implement your own library, but you have to think if this would be better for you. I suggest you not to do that. RabbitMQ is a well-known open source library that many people use and trust for years. I think there is no side-effect using that in any project.

Deploy RabbitMQ on Kubernetes with stateful sets. This will replicate state in multiple instances. One of them will be primary. Failover will be handled by Kubernetes. See https://kublr.com/blog/reliable-fault-tolerant-messaging-rabbitmq-kublr/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM