2
votes

I want to use the azure service-bus event-hub to send one single message to many instances of an application,considering that the goal isn't to load-balance, it's totally the opposed what i want to do is broadcast a message to all application instances regardless of witch partition it is. i have heard that i can do it using consumer groups but i didn't found any tutorial about it.

1
You could search keywords like "event hubs consumer group" in stackoverflow.Steven
Why do you want to use an eventhub for that ? Is it usefull for something else ?Thomas
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
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 messagesThomas
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

1 Answers

2
votes

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).