Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,34 @@ builder.AddRabbitMQClient(
static factory => factory.ClientProvidedName = "MyApp");
```

### Auto activation

Auto activation is a feature that helps prevent startup deadlocks in applications that use RabbitMQ. When auto activation is enabled, the RabbitMQ client connection is automatically opened when the application starts, rather than being lazily initialized on first use. This ensures that any connection issues are detected early during application startup, rather than during runtime operations.

#### When to enable auto activation

Auto activation is particularly useful in scenarios where:

- Your application needs to verify RabbitMQ connectivity during startup
- You want to fail fast if RabbitMQ is unavailable
- Your application architecture requires connections to be established before accepting traffic
- You're experiencing startup deadlocks or race conditions with lazy connection initialization

#### Configuration

Auto activation is **disabled by default** in Aspire 9.5 to maintain backward compatibility. To enable auto activation, set the `DisableAutoActivation` property to `false` in the `RabbitMQClientSettings`:

```csharp title="C# — Program.cs"
var builder = WebApplication.CreateBuilder(args);

// Enable auto activation
builder.AddRabbitMQClient("messaging", o => o.DisableAutoActivation = false);
```

<Aside type="note">
In a future version of Aspire, auto activation is planned to be **enabled by default**. When this change occurs, you'll need to explicitly set `DisableAutoActivation = true` if you want to maintain the lazy initialization behavior.
</Aside>

### Client integration health checks

By default, Aspire integrations enable health checks for all services. The Aspire RabbitMQ integration:
Expand Down
18 changes: 16 additions & 2 deletions src/frontend/src/content/docs/whats-new/aspire-9-5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,29 @@ builder.Build().Run();

### RabbitMQ auto activation

RabbitMQ client connections now support auto activation to prevent startup deadlocks and improve application reliability. Auto activation is disabled by default in 9.5, but planned to be enabled by default in a future release.
RabbitMQ client connections now support auto activation to prevent startup deadlocks and improve application reliability. When enabled, auto activation ensures that the RabbitMQ connection is established during application startup rather than being lazily initialized on first use. This helps detect connection issues early and prevents certain race conditions that can occur with lazy initialization.

Auto activation is **disabled by default** in Aspire 9.5 to maintain backward compatibility. In a future release, it's planned to be **enabled by default**.

**When to enable auto activation:**

- Your application needs to verify RabbitMQ connectivity during startup
- You want to fail fast if RabbitMQ is unavailable
- Your application requires connections to be established before accepting traffic
- You're experiencing startup deadlocks with lazy connection initialization

**Enable auto activation:**

```csharp
var builder = WebApplication.CreateBuilder(args);

// Auto activation is disabled by default for RabbitMQ, enable using DisableAutoActivation=false
// Auto activation is disabled by default for RabbitMQ
// Enable using DisableAutoActivation=false
builder.AddRabbitMQClient("messaging", o => o.DisableAutoActivation = false);
```

For more information, see [RabbitMQ integration - Auto activation](/integrations/messaging/rabbitmq/#auto-activation).

### Redis integration improvements

#### Auto activation
Expand Down