I used to use RabbitMQ as a messaging platform and I never had any issues with it - unfortunately, we've recently moved our infrastructure over to Azure and they don't provide RabbitMQ servers so I thought about trying out the Service Bus extension.
I have one writer and multiple readers. Currently, the readers will each read a different message (message competing pattern - e.g. good for load balancing).
What I want, is that all the readers get the same message and process it themselves.
The reader(s):
string connectionKey = "....";
this.client = QueueClient.CreateFromConnectionString(connectionKey, "dev");
this.client.OnMessage((message) =>
{
try
{
Console.WriteLine("Message received: " + message.GetBody<string>());
Console.WriteLine("Message ID: " + message.MessageId);
// message.Complete();
}
catch (Exception e)
{
Console.WriteLine("Exception " + e.Message);
}
});
The writer:
Console.WriteLine("Sending message " + message);
BrokeredMessage msg = new BrokeredMessage(message);
this.client.Send(msg);
I've been looking for a solution for two hours and couldn't find anything. In RabbitMQ, that would be the default behavior.