I have created a worker that can read azure bus service subscription, following examples on line. But can't find a way to have multiple workers in the same app that would read different subscriptions and do different things.
To create my app I have added the following to my Program.cs
services.AddSingleton<ISubscriptionClient>(x =>
new SubscriptionClient(Configuration["ServiceBus:ConnectionString"],
Configuration["ServiceBus:TopicName"],
Configuration["ServiceBus:SubscriptionName"]));
and in my worker:
private readonly ISubscriptionClient _subscriptionClient;
inside ExecuteAsync
_subscriptionClient.RegisterMessageHandler(async (message, token) =>
{ //do stuff }
Is there a way i can have each background worker use a different subscription?