UNPKG

pg-transactional-outbox

Version:

A PostgreSQL based transactional outbox and inbox pattern implementation to support exactly once message processing (with at least once message delivery).

21 lines (18 loc) 756 B
import { IsolationLevel } from '../common/utils'; import { StoredTransactionalMessage } from '../message/transactional-message'; /** * Defines which transaction isolation level should be used to handle the given * message. * @param message The stored message that should be handled * @returns A transaction isolation level or undefined - which uses then the database default isolation level */ export interface MessageProcessingTransactionLevelStrategy { (message: StoredTransactionalMessage): IsolationLevel | undefined; } /** * Get the default message processing transaction level strategy */ export const defaultMessageProcessingTransactionLevelStrategy = (): MessageProcessingTransactionLevelStrategy => () => { return undefined; };