-
Describe the bugHi, I'm trying to implement a rabbitmq connection that uses the ConnectionFactory with AutomaticRecoveryEnabled set to true. I was using code similar to what the documentation says. To make automatic recovery work I want to make sure that the first connection is created properly, so when a connection attempt fails I retry again after a 5 second delay. To simulate a rabbitmq that is unreachable I use a docker container running the latest image (rabbitmq:4.1.3-management). I start my dotnet service that tries to create the first connection at startup and as expected it fails at first with this exception:
After I start the rabbitmq container again the following exception is thrown a couple of times
The end result is that when I check the rabbitmq management frontend I see multiple connections have been created by my service. These connections are kept alive by automatic recovery, but I have no way to access them because the factory threw an exception while creating them. Reproduction steps
Expected behaviorOnly one rabbitmq connection should be created and kept alive by the factory Additional contextRabbitmq management version: 4.1.3 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi, thanks for using RabbitMQ and this client library. The simplest way for you to help me help you is to provide a git repository I can clone, compile, and run to observe this behavior. Doing that would save me the time it takes to set something up to test this. I can manage starting / stopping RabbitMQ. Thank you. |
Beta Was this translation helpful? Give feedback.
Hi, thanks for the quick response, and sorry if I created this in the wrong place. Here is a minimal example to reproduce the issue:
https://github.com/krisz2000/rabbitmq-reconnect-test
Lowering the Task.Delay time means getting more rogue connections. Please tell me if you need any more information and I'll try my best to provide that.