0

I need to send Azure IoT Hub events based on message type i.e. telemetry, state and health messages. Now I want to send these to 3 event hubs i.e telemetry message to go to first event hub, health to second event hub and state to 3rd event hub.

The issue I see in this approach is the ordering of events. Let's say for deviceID A telemetry event goes to event hub1, and state event goes to event hub 2. How can I make sure the consumer gets these 2 messages in order.

Note:- I don't want to use a single event hub as it will overload the consumer with irrelevant messages.

iAviator
  • 1,310
  • 13
  • 31
  • 1
    Can't you just keep relevant events on the same eventhub? Create as many as partitions you need to avoid overloading consumers. – Serkant Karaca Apr 21 '20 at 18:31
  • Yes I can do that but the issue is partitions are based on deviceids for iot hubs and I want the partitions to be based on message type then so that ordering of messages is maintained otherwise it's not. – iAviator Apr 21 '20 at 19:38
  • All messages from a device will land on same partition. I don't think you can change this behavior unless you manage your own partition senders. – Serkant Karaca Apr 21 '20 at 19:46
  • Correct I can't change this. So the consumer has to process the events based on message type in this case which might end up message disordering as multiple processors can be applied by consumer. – iAviator Apr 21 '20 at 19:49
  • What if consumer compared enqueue-time on events to decide which event came first? Would that work for you case? – Serkant Karaca Apr 23 '20 at 16:38
  • Yes that works but an overhead on consumer. Anyways we decided to have single eventhub and let the consumer handle parallel processing – iAviator Apr 23 '20 at 16:43

0 Answers0