Event Driven Architecture, Exactly One Delivery, Kafka, Message Broker, Software Development.
START TRANSACTION before sending a message, and declare COMMIT after the message is sent. If any of the intermediate messages fail, then the producer does not COMMIT but simply aborts the entire transaction and resends it. In this way, a failed resend does not result in a duplicate send. Consumer