A clerk portal sometimes retries the same AI job submit, risking double token spend. How should Service Bus protect the city’s summarization queue?
Select an answer to reveal the explanation.
Short Explanation
Duplicate detection is the city’s “we already stamped that form” stamp—same MessageId, same clerk request, no second bite out of the token budget.
Full Explanation
Clerk portals and flaky networks produce duplicate submits of the same civic AI job. Service Bus duplicate detection addresses that at the queue or topic level: enable it on the entity, have the portal send a stable MessageId for a given logical submit (for example a hash of clerk id, document id, and intent), and within the configured detection history window Service Bus discards duplicates before they create extra paid summarization runs. Consumers therefore see at-most-once enqueue semantics for identical MessageIds without custom dedupe stores for the happy path.
Disabling MessageId checks and relying on residents or clerks never to click submit twice fails on human factors and mobile networks: double-taps and retries after timeouts are normal, and policy cannot be “hope users are careful.” Accepting every retry as a brand-new paid summarization with no deduplication fails on cost and side effects: token spend doubles, downstream status rows fork, and operators chase ghost jobs. Using only Event Grid subject strings without Service Bus duplicate detection misses the mechanism: Event Grid has its own delivery semantics; it does not replace Service Bus entity-level MessageId duplicate detection for a summarization queue.
Exam caveat: duplicate detection requires a meaningful, stable MessageId from the producer; random GUIDs per retry defeat the feature. Also note the detection window is finite—very late retries outside the window can still enqueue. Operational check: submit the same summarization twice with the same MessageId inside the window and confirm only one active message; then verify application status APIs treat that id as one municipal job, not two billable runs.