I have 3 topics and 3 subscriptions. how to configure in appsettings json. i want to configure in existing below format. { "Azure": { "ServiceBus": { "Connections": { "Default": { "ConnectionString": "Endpoint=sb://sb-my-app.servicebus.windows.net/;SharedAccessKeyName={{Policy Name}};SharedAccessKey={};EntityPath=marketing-consent" } } }, "EventBus": { "ConnectionName": "Default", "SubscriberName": "MySubscriberName", "TopicName": "MyTopicName" } } }
4 Answer(s)
-
0
In ABP’s Azure Service Bus distributed event bus integration, the
Azure:EventBussection represents a single topic + a single subscription name per application:TopicName= the topic ABP publishes to / listens fromSubscriberName= the subscription name created/used under that topic for this application
Because of that, you can’t configure 3 topics + 3 subscriptions in the same
Azure:EventBussection inappsettings.jsonin the “existing format”. ABP reads oneTopicNameand oneSubscriberName.What you should do instead:
- Pick one topic for your whole solution (recommended), e.g.
MyApp. - Configure one
SubscriberNameper microservice/app (each consumer app uses a different subscription under the same topic). - If you truly must use multiple topics, you need separate applications/hosts with different
Azure:EventBusconfigs (one per topic) or implement a custom event bus provider/routing (not supported via appsettings in the default provider).
- Pick one topic for your whole solution (recommended), e.g.
Example (recommended): single topic, 3 subscriptions (3 apps)
appsettings.jsonfor ServiceA:
{ "Azure": { "ServiceBus": { "Connections": { "Default": { "ConnectionString": "Endpoint=sb://sb-my-app.servicebus.windows.net/;SharedAccessKeyName=...;SharedAccessKey=..." } } }, "EventBus": { "ConnectionName": "Default", "TopicName": "MyApp", "SubscriberName": "ServiceA" } } }appsettings.jsonfor ServiceB:
{ "Azure": { "ServiceBus": { "Connections": { "Default": { "ConnectionString": "Endpoint=sb://sb-my-app.servicebus.windows.net/;SharedAccessKeyName=...;SharedAccessKey=..." } } }, "EventBus": { "ConnectionName": "Default", "TopicName": "MyApp", "SubscriberName": "ServiceB" } } }appsettings.jsonfor ServiceC:
{ "Azure": { "ServiceBus": { "Connections": { "Default": { "ConnectionString": "Endpoint=sb://sb-my-app.servicebus.windows.net/;SharedAccessKeyName=...;SharedAccessKey=..." } } }, "EventBus": { "ConnectionName": "Default", "TopicName": "MyApp", "SubscriberName": "ServiceC" } } }If you put
EntityPath=...in the connection string: for topics/subscriptions, ABP already usesTopicName, so keep the connection string at the namespace level (noEntityPath) unless you have a specific reason.Link (verified): https://abp.io/docs/latest/framework/infrastructure/event-bus/distributed/azure
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
i would like to configure with one host app not multiple host app. so all my topic and subscription should be configure in same host app how to do it?
-
0
With ABP’s built-in Azure Service Bus distributed event bus provider, a single host application can be configured with only one
TopicNameand oneSubscriberNameviaAzure:EventBus(that config maps to one topic + one subscription for that app). There is no supportedappsettings.jsonformat to declare multiple topics/subscriptions for the same host using the default provider.If you must use one host app and still consume from 3 topic/subscription pairs, you have only these viable options:
Recommended ABP way: use 1 topic, 1 subscription, and let ABP route by event type
- Put all events on one Azure Service Bus topic (e.g.
MyApp). - Keep one subscription for the host (e.g.
MyHost). - ABP already dispatches incoming messages to handlers based on event name/type; you don’t need separate topics per event group.
- Config stays exactly like you already have (single topic/subscriber).
- Put all events on one Azure Service Bus topic (e.g.
If you strictly need 3 different topics: do it outside ABP EventBus
- Keep ABP’s distributed event bus configured for one topic/subscription (or disable it if you won’t use it).
- Then, for the other topics/subscriptions, use the raw Azure SDK (
Azure.Messaging.ServiceBus) and create your ownServiceBusProcessorinstances (one per topic/subscription) inside your host app. - This is not configurable “in the existing ABP
Azure:EventBusformat”; it’s custom code.
Because option (2) requires custom code and ABP has no official “multiple topics per app” configuration for the Azure EventBus provider, the direct answer to “how to do it in the same host app via appsettings” is: you can’t with the default ABP Azure EventBus configuration.
Link (validated): https://abp.io/docs/latest/framework/infrastructure/event-bus/distributed/azure
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
hi
Abp Azure event bus doesn't support multiple topics.
https://github.com/abpframework/abp/issues/22424
Thanks