2

I want to use the Azure service-bus event-hub to send a single message to many instances of an application but not with the goal of load-balancing.

What I want to do is broadcast a message to all application instances regardless of which partition it is.

I have heard that I can do it using consumer groups but I couldn't find any tutorials on it.

codersl
  • 2,222
  • 4
  • 30
  • 33
Khalil Liraqui
  • 385
  • 1
  • 5
  • 21
  • You could search keywords like "event hubs consumer group" in stackoverflow. – Steven Jun 27 '16 at 08:33
  • Why do you want to use an eventhub for that ? Is it usefull for something else ? – Thomas Jun 27 '16 at 12:40
  • i want to use it to communicate between my instances of azure WebApp every instance gonna post a messages and all other instances gonna see it. – Khalil Liraqui Jun 27 '16 at 13:10
  • 1
    You should have a look at the azure service bus topic/subscription. It seems to be more appropriate in your case. EventHub is usefull if you need to hamdle thousands of thousands of messages – Thomas Jun 27 '16 at 21:54
  • i think it works fine,i test it and the messages are broadcasted to all consumers and there is even a system of checkout to handle crashes. topic / sub si not much interesting in my case because its for complicate sénarios like having 5 apps, 2 are subscribed to some special events and 2 to other specific events and so on in my case i just wanna do a broadcast to all consumers . – Khalil Liraqui Jun 28 '16 at 07:35

1 Answers1

2

This scenario is relatively straight forward assuming you can consistently inject the same unique name into each application instance such as on the command line. If you want to use an EventProcessorHost just specify a different Consumer Group string for each application instance in the constructor. Then it will "load balance" to only one machine per group causing each instance to receive all the messages. There are fancier things you can do if you end up with more machines

I suggest looking at this for some additional discussion of Consumer Groups, or this which discusses using EventHubs as a backplane (basically what you're doing).

Community
  • 1
  • 1
cacsar
  • 2,098
  • 1
  • 14
  • 27