Background
I'm using RabbitMQ with C#. I have a remote queue with one publisher and one consumer. This is how I enqueue a message into the queue (publisher):
model.BasicPublish(exchange, routingKey, basicProperties, body);
I just figured out that this call is always a success (success = no error reported, exceptions). For example, even if I not connected to the network (the queue is unreachable) - it still passes this line and I don't know about it.
The Question:
In a complex system, reliability is above all. So how I can be sure that the message is enqueued into the queue?
I think that must be a mechanism to:
- Retry message queue insertion in case of retry
- A reporting system that will give a report before the producer will drop the message (won't be tried again).
Possible solution
I saw here that I can implement something like transaction, which makes the call atomic and also reports in case of error. For me, it looks like "too big hammer". Transactions have large effect on performance.