Hi Team,
I have a situation where i am trying to implement pub/sub pattern.
Using Azure i am publishing message and coming to client if two clients are subscribed to same topic & subscription only one of it is getting message other client is not getting.
To put it simple:
I am broadcasting message and two persons are subscribed to my Topic. When i broadcast message only one person is getting that message other doesn't get. Below is sample code.
subscriptionClient = new SubscriptionClient(sbConnectionString, sbTopic, sbSubscription); var messageHandlerOptions = new MessageHandlerOptions(ExceptionReceivedHandler) { MaxConcurrentCalls = 100000, AutoComplete = false, }; subscriptionClient.RegisterMessageHandler(ReceiveMessagesAsync, messageHandlerOptions);
static async Task ReceiveMessagesAsync(Message message, CancellationToken token)
{
Console.WriteLine($"Subscribed message: {Encoding.UTF8.GetString(message.Body)}");
//await subscriptionClient.CompleteAsync(message.SystemProperties.LockToken);
}
Please let me know if i am missing anything or Azure Service topic is wrong option in this case.
I tried AMPS it works like charm broadcasting to all subscribers