I am using MassTransit and RabbitMQ. When RabbitMQ RAM usage exceeds a certain Limit, a memory alarm is raised. In the overview of the RabbitMQ managment website the memory indicator changes red and states
The memory alarm for this node has gone off. It will block incoming network traffic until the memory usage drops below the watermark.
While in this state my service still tries to publish messages using MassTransit. But the publish async task will never complete / wait for continuation forever. To me it seems there is some timeout mechanism missing in MassTransit publish. I would expect an exception, if a message can not be published after a certain duration. I do not find a way to configure time out behaviour.
How do you deal with this situation?
Thanks
The Publish
method accepts a CancellationToken
, which can be used to cancel the publish. This was previously answered with a code sample of how to specify a timeout.