Azure Event Grid · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services
An Event Grid subscription invokes a payment-processing webhook. Because Event Grid provides at-least-once delivery, the same event can occasionally…
Practice question from Azure Event Grid (AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services), with the correct answer and a step-by-step solution.
hard · MCQ · Q-D4520A
An Event Grid subscription invokes a payment-processing webhook. Because Event Grid provides at-least-once delivery, the same event can occasionally be delivered more than once. The webhook must never charge a customer twice for the same event. Which design best addresses this requirement?
- A.Ignore duplicate deliveries because Event Grid guarantees exactly-once delivery
- B.Process only the first event received during each five-minute interval
- C.Use the Event Grid event.id as an idempotency key with the payment operation or a durable deduplication storeCorrect answer
- D.Return HTTP 500 for every event so Event Grid stops delivering duplicates
Solution
Event Grid can retry deliveries, so consumers must be idempotent. Persisting the event ID or passing it as an idempotency key to a payment provider lets the handler detect repeated deliveries without performing the charge again.
More from Azure Event Grid
- A company publishes custom business events when an order is created. The company needs to deliver each event independently to an Azure Func…
- You create an Azure Event Grid event subscription that uses an HTTPS webhook endpoint. During creation, Event Grid sends a SubscriptionVali…
- A solution must react whenever a blob is created in an Azure Storage account. The team wants Azure to publish the platform-generated storag…
- A storage account publishes BlobCreated events. An Azure Function should receive only events for .jpg files stored in the photos container.…
Practise more Connect to and Consume Azure and Third-party Services
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed