A Service Bus transaction cannot undo model tokens already spent on a failed civic enrichment. What design lesson applies?
Select an answer to reveal the explanation.
Short Explanation
Tokens are like stamps already licked—Service Bus can’t peel them off a failed enrichment, so design for idempotent make-up work instead.
Full Explanation
A Service Bus transaction can coordinate message settlement with some transactional resources, but it cannot unwind Azure OpenAI token spend already incurred on a failed civic enrichment. Generative side effects are non-transactional: once tokens are consumed and a partial draft may exist, design idempotent retries and compensating steps (skip if output exists, mark enrichment failed, enqueue repair) around messaging rather than expecting the broker to refund the model bill.
Assuming Service Bus transactions refund Azure OpenAI charges is false and leads to broken cost and consistency assumptions for municipal AI. Wrapping every model call "inside" a Service Bus transaction does not make token meters transactional. Disabling messaging whenever an AI call might fail removes the reliability layer the city needs for asynchronous enrichment.
Exam caveat: treat LLM calls like irreversible external side effects—similar to sending email or charging a card. Combine at-least-once messaging with idempotent handlers and explicit compensation; do not confuse broker transactions with distributed undo for generative APIs.
Operational check: simulate an enrichment that spends tokens then fails before completion, abandon or dead-letter the message, reprocess with the same business key, and verify the handler detects prior partial output or uses a compensating cleanup path without double-billing logic that assumes a broker refund.