Skip to content

Commit 7a6cc74

Browse files
committed
[Host.RabbitMQ] connection resiliency
Signed-off-by: Tomasz Maruszak <[email protected]>
1 parent 124c735 commit 7a6cc74

File tree

10 files changed

+1152
-152
lines changed

10 files changed

+1152
-152
lines changed

docs/provider_rabbitmq.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Please read the [Introduction](intro.md) before reading this provider documentat
1414
- [Consumer Concurrency Level](#consumer-concurrency-level)
1515
- [Request-Response](#request-response)
1616
- [Topology Provisioning](#topology-provisioning)
17-
- [Not Supported](#not-supported)
17+
- [Default Exchange](#default-exchange)
18+
- [Why it exists](#why-it-exists)
19+
- [Connection Resiliency](#connection-resiliency)
1820
- [Recipes](#recipes)
1921
- [01 Multiple consumers on the same queue with different concurrency](#01-multiple-consumers-on-the-same-queue-with-different-concurrency)
2022
- [Feedback](#feedback)
@@ -362,7 +364,7 @@ services.AddSlimMessageBus((mbb) =>
362364
Avoiding the call `applyDefaultTopology()` will suppress the SMB inferred topology creation.
363365
This might be useful in case the SMB inferred topology is not desired or there are other custom needs.
364366

365-
### Default Exchange
367+
## Default Exchange
366368

367369
In RabbitMQ, the default exchange (sometimes referred to as the default direct exchange) is a pre-declared, nameless direct exchange with a special behavior:
368370

@@ -374,16 +376,6 @@ This means:
374376

375377
- When you publish a message to the default exchange (exchange name = `""`) with a routing key set to the queue name, the message is delivered directly to that queueno explicit binding is needed.
376378

377-
Example:
378-
379-
```csharp
380-
channel.basic_publish(
381-
exchange: "", // default exchange
382-
routing_key: "my_queue", // must match the queue name
383-
body: Encoding.UTF8.GetBytes("Hello World!")
384-
);
385-
```
386-
387379
This will deliver the message straight to the `my_queue` queue.
388380

389381
### Why it exists
@@ -397,6 +389,16 @@ The default exchange makes it easy to send messages directly to a queue without
397389
- Auto-binds every queue by its own name.
398390
- Messages published to it must use the queues name as the routing key.
399391

392+
## Connection Resiliency
393+
394+
The `RabbitMqChannelManager` provides enhanced connection resilience:
395+
396+
- **Continuous Retry**: Unlike the previous 3-attempt limit, the connection now retries indefinitely in the background
397+
- **Automatic Recovery**: Integrates with RabbitMQ's built-in automatic recovery features
398+
- **Connection Monitoring**: Monitors connection shutdown events and triggers reconnection
399+
- **Health Integration**: The health check provides visibility into connection retry status
400+
- **Thread-Safe Operations**: All channel operations are properly synchronized
401+
400402
## Recipes
401403

402404
### 01 Multiple consumers on the same queue with different concurrency

src/Host.Plugin.Properties.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Import Project="Common.NuGet.Properties.xml" />
55

66
<PropertyGroup>
7-
<Version>3.3.2-rc102</Version>
7+
<Version>3.3.2-rc103</Version>
88
</PropertyGroup>
99

1010
</Project>

src/SlimMessageBus.Host.Configuration/SlimMessageBus.Host.Configuration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Description>Core configuration interfaces of SlimMessageBus</Description>
77
<PackageTags>SlimMessageBus</PackageTags>
88
<RootNamespace>SlimMessageBus.Host</RootNamespace>
9-
<Version>3.3.2-rc102</Version>
9+
<Version>3.3.2-rc103</Version>
1010
</PropertyGroup>
1111

1212
<ItemGroup>

0 commit comments

Comments
 (0)