Hi,
As per Azure Service Bus pricing, I'm going to opt for standard tier as I need to create a session enabled queue so that 1000s of my clients can initiate a session (using a dynamic session guid) & receive message meant for them only (one client doesn't receive message meant for other client):
- Let's say I have 1000 web app clients (each with a unique session id) expecting message from a service bus queue. Can a single session enabled service bus queue handle this scenario where each client connects to bus using session filter (using a dynamic session guid) & receives response using that session id such that a client only receives his/her message and all 1000 clients can receive the message quickly?
- How can I make Non-Brokered connections to this session enabled service bus queue so that I do not hit 1000 brokered connections limit? Is the following code making non brokered connections?
Sample Sender
QueueClient responseClient = MessagingFactory.CreateFromConnectionString("Endpoint=sb://XXXXXX").CreateQueueClient("ResponseQueue");
BrokeredMessage response = new BrokeredMessage();
response.SessionId = "XYZ";
response.MessageId = "XYZ";
responseClient.Send(response);
Sample Receiver
QueueClient responseClient = MessagingFactory.CreateFromConnectionString("Endpoint=sb://XXXXXX").CreateQueueClient("ResponseQueue");
MessageSession receiver = responseClient.AcceptMessageSession("XYZ");
BrokeredMessage receivedMessage = receiver.Receive(new TimeSpan(0, 0, 20));//Shall I set time to TimeSpan (0, 0, 20) to make it a non brokered connection?
if (receivedMessage != null)
{
Console.WriteLine(receivedMessage.MessageId + " " + receivedMessage.SessionId);
receivedMessage.Complete();
}
Thanks,
Gurpreet