0x4b53 / amqp-rpc

🐰 Framework to use RabbitMQ as RPC
MIT License
45 stars 8 forks source link

Ensure the client is more fault tolerant #75

Closed akarl closed 5 years ago

akarl commented 5 years ago

Changes the DeleteWhenUnused: true to instead use x-expires to ensure the queue is deleted later instead of right away. This is so we reuse the same queue previously created (and is's queued messages) when we reconnect during a node failure.

Adds configurable maxRetries with a default of 10. In theory this should ensure the client can keep re-connecting a few more times before giving up sending the request.

.Stop() now waits for the client connections to properly shut down before returning. This ensures that RabbitMQ won't log the "Unexpected shutdown" logs in tests.

bombsimon commented 5 years ago

Again, this looks great! And nice fix with Travis! Feel free to merge whenever! :)