admin管理员组文章数量:1122846
I have a setup where two servers (let's call them server-A and server-B) communicate via RabbitMQ. RabbitMQ is configured in an active-passive (mirrored queue) setup. Here’s the flow:
- server-A receives API requests, processes them partially, and sends them to server-B via RabbitMQ.
- server-B processes the request, sends the response back to server-A using RabbitMQ, and server-A then returns the response to the client.
The RabbitMQ setup consists of two nodes, with one node acting as active and the other as passive. If the active node goes down gracefully, the passive node takes over, and everything works seamlessly.
However, if the active RabbitMQ node crashes abruptly (e.g., due to a forced shutdown or unexpected server issue), the passive node does not take over, and all API requests fail until the active node comes back online. This problem surfaced during an unexpected OS update, where the active RabbitMQ node crashed without prior notice.
I’m using Spring and Spring AMQP for RabbitMQ configuration in both server-A and server-B.
Questions:
- How can I ensure the passive node takes over seamlessly when the active node crashes abruptly?
- Are there any specific configurations in RabbitMQ or Spring AMQP that I need to adjust to handle this scenario?
What I’ve Tried and Found:
- Verified RabbitMQ setup and failover configurations.
- Tested graceful shutdown scenarios, and failover functions correctly. Once the connections to the active node are closed, the application begins using the RabbitMQ connections to the passive node.
- Noticed that in abrupt shutdown scenarios, the application appears to only attempt to send messages to the active node. There are no logs for closed connections; the log entries for closed connections only appear when the node comes back up and is in a healthy state. At that point, the passive node takes over and begins processing the messages.
本文标签: springRabbitMQ ActivePassive Setup Fails to Switch When Active Node Crashes AbruptlyStack Overflow
版权声明:本文标题:spring - RabbitMQ Active-Passive Setup Fails to Switch When Active Node Crashes Abruptly - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283239a1926902.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论