I have set up Azure Event Hub. There are 2 publishers:
Publisher 1 (with Send Policy)
Publisher 2 (with Send Policy)
Publisher 1 will send Event 1 and Publisher 2 will send Event 2. Both Event 1 & Event 2 are different format.
Question 1: This would mean we have different messages in EH - what are the tradeoff with this approach? Should I instead create 2 EH (one for Publisher 1 and another for Publisher 2)? What is the best practice and design philosophy?
If I go with above approach, I would have to set up a Consumer with Listen Policy to look for these events and parse/transform these events and de-serialize these.
Question 2: Would I need 2 Consumers (Consumer 1 and Consumer 2) to read messages meant for them ? (Consumer 1 will read only Event 1 and Consumer 2 will read only Event 2)?
Scenario 1: One Event Hub for multiple event types
In this scenario you have multiple options when it comes to sending and processing the messages:
Scenario 2: An Event Hub per event types
This one is easy, just create 2 event hubs and 2 consuming processes. But you'll have to manage 2 event hubs and given the abilities of an Event Hub it might be overkill.
My advice
It depends on the amount of data, but based on my experience I would go to send all messages the one event hub and have one process reading the message and perform an action based on the message type using some c# code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With