简体   繁体   English

Rabbit MQ 容错

[英]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.我有一个项目,我们正在使用 Rabbit MQ 有消息代理,我有以下问题,请帮忙。

  1. If Rabbit MQ goes down, how we can retrieve the queued message.is there any configuration in rabbit MQ?如果 Rabbit MQ 出现故障,我们如何检索排队的消息。Rabbit MQ 中是否有任何配置?
  2. Can we implement same in java thread and collection combination, that can be used as alternative to rabbit MQ?我们可以在java线程和集合组合中实现相同的,可以用作rabbit MQ的替代品吗? if yes help with an example.如果是,请举个例子。
  1. 'You should listen to ShutdownListener callback on both Connection and Channel classes'. “您应该在ConnectionChannel类上都监听ShutdownListener回调”。 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 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. RabbitMQ是一个众所周知的开放源代码库,许多人多年来一直在使用和信任它。 I think there is no side-effect using that in any project. 我认为在任何项目中使用它都没有副作用。

Deploy RabbitMQ on Kubernetes with stateful sets.使用有状态集在 Kubernetes 上部署 RabbitMQ。 This will replicate state in multiple instances.这将在多个实例中复制状态。 One of them will be primary.其中之一将是主要的。 Failover will be handled by Kubernetes.故障转移将由 Kubernetes 处理。 See https://kublr.com/blog/reliable-fault-tolerant-messaging-rabbitmq-kublr/https://kublr.com/blog/reliable-fault-allowance-messaging-rabbitmq-kublr/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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