You ingest telemetry from 100,000 devices into an Azure Event Hub. You must preserve per-device message order while maintaining high throughput across multiple partitions. What should you do when sending events?
Choose an answer
Tap an option to check your answer.
Correct answer: Set the PartitionKey on each event to the deviceId so all events from the same device land in the same partition and preserve ordering..
Why this is the answer
Setting the PartitionKey to the deviceId ensures that all events from a specific device are routed to the same Event Hub partition. This is crucial for preserving per-device message order because ordering is only guaranteed within a single partition. By using the deviceId as the PartitionKey, you leverage Event Hub's partitioning mechanism to maintain this order while distributing the overall load across multiple partitions, thus achieving high throughput. Reducing the number of partitions to 1 would guarantee global ordering but severely limit throughput, failing the high throughput requirement. Specifying PartitionId in a round-robin fashion would distribute events but destroy per-device ordering. Using separate consumer groups per device helps with processing but doesn't guarantee producer-side ordering within Event Hub. Checkpointing on the consumer preserves consumer-side processing state, not producer-side message order.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed