Microservice provides an outbox table within its database.
Outbox table will include all the events.
▪ There will be a CDC (change data capture) plugin that reads the commit log of the outbox table and publish the events to the relevant queue.
▪ It provides that messages are reliably delivered from a microservice to another microservice even if the transaction that triggered the message fails.
▪ It involves storing the message in a local "Outbox" table within the microservice, that message sent to the consumer after the transaction is committed.
▪ Outbox pattern can be used to ensure that messages are delivered consistently, even if the microservice that sent the message is unavailable or experiencing errors.
▪ Useful for communicating important information or updates between services
https://microservices.io/patterns/data/transactional-outbox.html