Skip to content

Commit e39a164

Browse files
authored
update readme.md
1 parent 5aef74b commit e39a164

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,25 @@ services.AddCap(x =>
287287
});
288288
```
289289

290+
### Azure Service Bus Emulator Support
291+
292+
The [Azure Service Bus Emulator](https://learn.microsoft.com/en-us/azure/service-bus-messaging/overview-emulator) uses separate ports for AMQP messaging (5672) and the HTTP Admin API (5300). Because CAP uses a single connection string for both the `ServiceBusClient` (AMQP) and the `ServiceBusAdministrationClient` (HTTP), it cannot target both ports simultaneously.
293+
294+
To work around this, set `AutoProvision` to `false` to skip automatic creation of topics, subscriptions, and rules via the Admin API. You must pre-create the required entities in the emulator's configuration instead.
295+
296+
```csharp
297+
services.AddCap(x =>
298+
{
299+
x.UseAzureServiceBus(opt =>
300+
{
301+
opt.ConnectionString = "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;";
302+
opt.AutoProvision = false;
303+
});
304+
});
305+
```
306+
307+
> **Note:** When `AutoProvision` is `false`, topics, subscriptions, and subscription filter rules must already exist before the application starts. This option is also useful when entities are managed externally (e.g., via Infrastructure as Code).
308+
290309
## Dashboard
291310

292311
CAP provides a real-time dashboard to view sent and received messages and their status.
@@ -307,4 +326,4 @@ We welcome contributions! Participating in discussions, reporting issues, and su
307326

308327
### License
309328

310-
CAP is licensed under the [MIT License](https://github.com/dotnetcore/CAP/blob/master/LICENSE.txt).
329+
CAP is licensed under the [MIT License](https://github.com/dotnetcore/CAP/blob/master/LICENSE.txt).

0 commit comments

Comments
 (0)