NOTE

2.11 Best-Effort Notification Implementation: MQ

After a local transaction, the producer sends a message to MQ. The consumer acknowledges success, requeues on failure, and can query the producer for message status.

Distributed Systems1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. What It Is

  1. The producer finishes executing its local transaction and sends a message to MQ.
  2. MQ sends the message to the consumer.
  3. The consumer consumes the message and executes its local transaction; on success, it sends an ACK; on failure, it sends a NACK and requeues the message.
  4. The consumer can query message status through the producer’s API.

2. Characteristics

It is similar to Distributed Transaction Solution: Reliable-Message Eventual Consistency.md (the original link is no longer valid). It depends on MQ and allows a small number of distributed transactions to fail.

2.1. Best-Effort Notification vs Reliable-Message Eventual Consistency

Best-effort notification Reliable-message eventual consistency
Failure retry The consumer queries the producer’s API The producer periodically checks for unprocessed messages and sends them to the consumer

3. Implementation

4. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub