You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

azure-service-bus.md 1.3 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Azure Service Bus
  2. Microsoft Azure Service Bus is a fully managed enterprise integration message broker. Service Bus is most commonly used to decouple applications and services from each other, and is a reliable and secure platform for asynchronous data and state transfer.
  3. Azure services can be used in CAP as a message transporter.
  4. ## Configuration
  5. !!! warning "Requirement"
  6. For the Service Bus pricing layer, CAP requires "standard" or "advanced" to support Topic functionality.
  7. To use Azure Service Bus as a message transport, you need to install the following package from NuGet:
  8. ```powershell
  9. PM> Install-Package DotNetCore.CAP.AzureServiceBus
  10. ```
  11. Next, add configuration items to the `ConfigureServices` method of `Startup.cs`:
  12. ```csharp
  13. public void ConfigureServices(IServiceCollection services)
  14. {
  15. // ...
  16. services.AddCap(x =>
  17. {
  18. x.UseAzureServiceBus(opt=>
  19. {
  20. //AzureServiceBusOptions
  21. });
  22. // x.UseXXX ...
  23. });
  24. }
  25. ```
  26. #### AzureServiceBus Options
  27. The AzureServiceBus configuration options provided directly by the CAP:
  28. NAME | DESCRIPTION | TYPE | DEFAULT
  29. :---|:---|---|:---
  30. ConnectionString | Endpoint address | string |
  31. TopicPath | Topic entity path | string | cap
  32. ManagementTokenProvider | Token provider | ITokenProvider | null