Guaranteed messages delivery:Challenges of transactional outbox & Inbox patterns

Abstract from Wikipedia

The application receives data which it persists to an inbox table in a database. Once the data has been persisted another application, process or service can read from the inbox table and use the data to perform an operation which it can retry upon failure until completion, the operation may take a long time to complete. The inbox pattern ensures that a message was received (e.g. to a queue) successfully at least once.

inbox pattern

The application persists data to an outbox table in a database. Once the data has been persisted another application or process can read from the outbox table and use that data to perform an operation which it can retry upon failure until completion. The outbox pattern ensures that a message was sent (e.g. to a queue) successfully at least once.

outbox pattern