Alipay callback queue failures: durable outbox, replay and fulfillment evidence

A queue connection failure after payment verification must not require another customer payment. Nor should an in-memory sent flag be the only evidence. This is a merchant-side handoff between database and fulfillment queue, using the actual 稳付pay callback protocol; no hosted outbox or recovery service is claimed.

Continue by topic

Define the responsibility being durably accepted

Verify the actual signature protocol and check merchant, original order, currency, amount and successful payment. Keep verified payment, pending fulfillment and completed delivery distinct. Unknown orders or amount conflicts remain exceptions regardless of queue availability.

For delivery across services, store the payment fact and pending event in one database transaction. Reference a stable purchase identity, product snapshot and internal delivery version. These are merchant records, not callback parameters. Acknowledge only after durable acceptance and recoverable responsibility exist, and confirm asynchronous handling fits the integration requirements.

Commit business data and outbox atomically

Lock the order or check its version, deduplicate the payment identity, and create the payment update and unique delivery event together. Rollback must leave neither a successful payment update without its task nor an orphan event. Query-confirmed payments use the same path.

A separate relay publishes pending events. Mark publication only after the broker's agreed durable-acceptance evidence. A crash after sending but before marking leaves an uncertain result and may require resending the same event. Do not assume a relay can eliminate every duplicate.

Recover three crash windows using the same identities

Illustration: order O produces event E. Before commit, rollback leaves O for later reconciliation. After commit but before sending, the relay finds durable E. After broker acceptance but before marking, E may be published again. None creates another payment or purchase.

The consumer deduplicates by delivery identity and event version, committing its processed marker with the entitlement change. Two copies of E contribute once locally. An external entitlement system needs its own real idempotency or query evidence; local uniqueness does not guarantee exactly-once external effects.

Reconcile backlog and bound replay

Track paid-but-unpublished, broker-accepted-but-undelivered, unknown delivery and permanent failures separately. Record oldest pending age, cause, owner and next review. These are operational metrics, not payment success rates. Escalate bounded failures instead of retrying forever.

Replay original E after checking refunds, revoked products and existing fulfillment. Test queue outage, rollback, uncertain sends, concurrent consumers and already-granted access using owned synthetic data. Acceptance should trace O through E to delivery evidence, not merely a sent message.

Frequently asked questions

Does broker acceptance prove the customer received access?

No. Durable queue acceptance and fulfilled entitlement are separate evidence. Completion requires the consumer result and actual delivery record.

Can another provider's callback response example be reused?

No. Use the actual 稳付pay verification, acknowledgment and retry contract. An internal outbox does not alter that protocol.

References