Message Consumers stop after RabbitMq restart
See original GitHub issueIs this a bug report?
Yes
Can you also reproduce the problem with the latest version?
Yes, MassTransit 5.2.3.
Environment
- Operating system: Windows 10 Pro
- Visual Studio version: 2017
- Dotnet version: Core 2, Net Framework 4.7.1.
- Language version: C# 7.1 or higher
- RabbitMq version: 3.7.3
Steps to Reproduce
See repository on https://github.com/jlandheer/MassTransitReconnectTest
Basically create a client with a static async Task Main(string[] args) startup method and start the receiving bus with await bus.StartAsync();. Stop the RabbitMq service and start it again. The receiver will not receive messages after restart.
When using the synchronous version there is no problem.
Expected Behavior
Client should continue to receive messages after service restart.
Actual Behavior
Client stops receiving messages after service restart.
Reproducible Demo
See repository on https://github.com/jlandheer/MassTransitReconnectTest
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Rabbitmq requeue all the message after restarted
If the messages are still available on queue after stopping the consumer , then there must be some issue on the consumer code....
Read more >Consumer doesn't consume messages after RabbitMQ restart
Consumer always reconnects to queue. Actual Behavior. Consumer doesn't reconnect to queue. At channel section in RabbitMQ management message: ".
Read more >Why are messages lost when I restart a RabbitMQ broker
You have several messages in queue and for some reason you need to restart the broker. Once the broker was restarted your messages...
Read more >Consumers
When a new consumer is added, assuming there are already messages ready in the queue, deliveries will start immediately. The target queue can...
Read more >RabbitMq Client stops consuming messages - Rabbit MQ
The issue we face is that not all messages that are pushed to the message queue are consumed. After a random amount of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Wow, good catch. Changed it to
await Task.Run(() => Console.ReadKey());, and as the French say: voilà!I had the same problem. Thanks for the tip, I wouldn’t have found the solution without you!