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).
18 lines • 1.26 kB
TypeScript
import { TransactionalLogger } from '../common/logger';
import { GeneralMessageHandler } from '../handler/general-message-handler';
import { TransactionalMessageHandler } from '../handler/transactional-message-handler';
import { PollingListenerConfig } from './config';
import { PollingMessageStrategies } from './polling-strategies';
/**
* Initialize the listener to watch for outbox or inbox table inserts via
* polling the corresponding PostgreSQL database tables.
* @param config The configuration object with required values to connect to the database for polling.
* @param messageHandlers A list of message handlers to handle specific messages or a single general message handler that handles all messages.
* @param logger A logger instance for logging trace up to error logs
* @param strategies Strategies to provide custom logic for handling specific scenarios
* @returns Functions for a clean shutdown.
*/
export declare const initializePollingMessageListener: (config: PollingListenerConfig, messageHandlers: TransactionalMessageHandler[] | GeneralMessageHandler, logger: TransactionalLogger, strategies?: Partial<PollingMessageStrategies>) => [shutdown: {
(): Promise<void>;
}];
//# sourceMappingURL=polling-message-listener.d.ts.map