mongo-extensions
mongo-extensions copied to clipboard
Misg/outbox
Adds a new Package that supports the Outbox Pattern.
- Messages to consume get saved in a new collection
outbox.messages
- Handling the initial transaction that saves the message is the responsibility of the user of the package
- The messages get consumed only once. A distributed semaphore is managed through special read/write preferences in MongoDb so that a message can get locked by one consuming application for a specified time (30 seconds by default). If the consuming application does not delete the message within that time, the message becomes available again for consumption.
- Messages get consumed right away: consumers get triggered via ThreadChannel to consume new messages asap. If the consumers fail for some reason, then a background job (named Fallback job) will get the message eventually and consume it.