A callback fired with a new session where additional persistance can be done along with the event(s).
session
A passed (new) session.
The database passed during the {OutboxConsumer} creation.
An empty promise.
await outbox.publish(event, async (session, db) => { await db.collection('test').insertOne( { param: 1, }, { session }, ) }) Copy
await outbox.publish(event, async (session, db) => { await db.collection('test').insertOne( { param: 1, }, { session }, ) })
A callback fired with a new
session
where additional persistance can be done along with the event(s).