1

This is a general question about Microsoft.Azure.ServiceBus. In Azure, when an application is scaled up, how does Azure handle dispatching messages to a subscriber if that subscriber has been scaled up multiple times. Figure 1 shows a typical situation, Figure 2 shows the scenario I am talking about:

enter image description here

By default, does Azure send the same messages to all instances? Or is Azure "smart" enough to load balance the messages between instances? If not, how do people handle this situation normally? I only want one instance to receive this message in the case it's scaled.

Andy
  • 12,859
  • 5
  • 41
  • 56

1 Answers1

0

Azure Service Bus is going to to send a copy of the published message to all the subscribers.

If you scaled out subscriber using the same subscription entity, then you've got a completing consumer sceanrio where a message arriving to the subscription will be handled by a single subscriber instance. That is assuming processing doesn't fail and message is completed. Otherwise message will be handled again by another instance.

The first scenario is going to work when each instance of the subscriber is listening to a different physical subscription.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80
  • Thanks for the info. Would an `EventHub` be a better option for me? They have a leasing mechanism that seems to accomplish what I need and it's a lot clearer. – Andy Dec 19 '17 at 20:40