Skip to content

Conversation

@zarusz
Copy link
Owner

@zarusz zarusz commented Oct 14, 2025

Issue

When the RabbitMQ connection is recovered by RabbitMqChannelManager, it creates a new channel and provisions topology, but the existing consumers that were created in OnStart() are not being recreated. The AsyncEventingBasicConsumer instances are still attached to the old, closed channel.

Here's the issue:

  1. AbstractRabbitMqConsumer.OnStart() creates an AsyncEventingBasicConsumer and calls BasicConsume() on the channel
  2. When RabbitMQ restarts, RabbitMqChannelManager detects the connection loss and creates a new connection and channel
  3. However, the consumers are never notified about this and don't re-register themselves with the new channel
  4. Messages accumulate in the queue because there are no active consumers

Solution

The fix requires implementing a mechanism to notify consumers when the channel is recovered, so they can re-register themselves.

Fixes #436

@zarusz zarusz force-pushed the feature/436 branch 5 times, most recently from 3e25d94 to 1beae69 Compare October 22, 2025 08:55
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
59.7% Coverage on New Code (required ≥ 75%)

See analysis details on SonarQube Cloud

@zarusz zarusz merged commit af53a83 into master Oct 22, 2025
5 of 7 checks passed
@zarusz zarusz deleted the feature/436 branch October 22, 2025 09:49
@zarusz zarusz added this to the 3.3.5 milestone Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Host.RabbitMQ] RabbitMQ server restart causes SlimMessageBus to lose channels

2 participants