How can I create a connection even if my RabbitMQ Server is offline? #1513
Closed
marco-carvalho
started this conversation in
General
Replies: 2 comments
-
RabbitMQ clients can only connect to a running node. This is not different from the absolute majority of messaging and data services. The only option for your applications is to retry and/or use a list of endpoints when connecting (assuming that at least one of them would be online). Several related doc guides:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Connection recovery is not the same scenarios as an initial connection in many ways. Initial connection with retries is usually trivial to implement in your own code:
That's all there is to it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
When deploying a C# program that establishes a
sharedConnection
to a RabbitMQ server with autorecovery enabled, the connection persists as expected even if the RabbitMQ server goes offline. However, if the server remains offline and the program is redeployed, attempting to re-establishsharedConnection
results in a null reference, and subsequent connection attempts throw an exception instead of waiting to recover when the server becomes available again.Reproduction steps
sharedConnection
with autorecovery enabled.sharedConnection
still exists (is not null) due to autorecovery being on.sharedConnection
is now null, and attempts to connect to RabbitMQ throw an exception.Expected behavior
Even when the RabbitMQ server is offline at the time of the application deployment, the client should initialize sharedConnection in a manner that allows autorecovery to attempt reconnections until the server becomes available again, instead of immediately throwing an exception.
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions