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).
16 lines • 1.17 kB
TypeScript
import EventEmitter from 'events';
import { TransactionalLogger } from '../common/logger';
import { StoredTransactionalMessage } from '../message/transactional-message';
import { PollingListenerConfig } from '../polling/config';
import { ReplicationListenerConfig } from '../replication/config';
import { GeneralMessageHandler } from './general-message-handler';
import { HandlerStrategies } from './handler-strategies';
import { TransactionalMessageHandler } from './transactional-message-handler';
export type ListenerType = 'replication' | 'polling';
/**
* Executes the message verification and poisonous message verification in one
* transaction (if enabled) and the actual message handler and marking the
* message as processed in another transaction.
*/
export declare const createMessageHandler: (messageHandlers: TransactionalMessageHandler[] | GeneralMessageHandler, strategies: HandlerStrategies, config: PollingListenerConfig | ReplicationListenerConfig, logger: TransactionalLogger, listenerType: ListenerType) => ((message: StoredTransactionalMessage, cancellation: EventEmitter) => Promise<void>);
//# sourceMappingURL=create-message-handler.d.ts.map