0

We are working with a cluster of two RabbitMQ nodes and we are using RabbitMQ Java driver to interact with the nodes. We are using a "headers" exchange which transmit messages to queues based on header bindings and persistent queues.

The thing is, queues are defined for one node. If this node crash for some reason, messages that should arrive in queues of this node are lost.

Is there a way to tell RabbitMQ to change queue home node when it detects that another node that hold them is unreachable and so, ensure messages are transmitted to the queue ? And to recover messages when the node comes up again ?

For now, we are using high available queues to solve this problem but performance are pretty bad. We don't need mirroring features it provides, as it is fine for us to only recover messages when node comes up again

0

1 Answer 1

1

You need to make messages persistent bu setting the delivery_mode to 2 and declare queues durable. In that way the queues are back when the nodes are restarted and the messages are saved. More in the second tutorial. Actually I don't see in the tutorial how to it in java, but it's there in phyton, so you'd need to look up in javadoc, probably also a parameter in the 'publish' method.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, we've tried this. It recovers messages delivered before a node crash when the node comes up again. But when the node is down, queues with this node as home node, are still ignoring new messages until the node comes up again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.