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 • 1.04 kB
TypeScript
import { FullPollingListenerConfig } from '../config';
/**
* Define the batch size strategy how many messages should be loaded at once.
*/
export interface PollingListenerBatchSizeStrategy {
/**
* Defines the number of records that should be loaded from the database table.
* @param currentlyProcessed The number of currently processed messages
* @returns The max number of records to load
*/
(currentlyProcessed: number): Promise<number>;
}
/**
* The default batch size strategy returns the configured value from the
* `nextMessagesBatchSize`. But the first few times until the batch size is
* reached it will tell to return only one message. This protects against
* poisonous messages: if the full batch size would be taken during startup all
* those messages would be marked as poisonous if one of them fails.
*/
export declare const defaultPollingListenerBatchSizeStrategy: (config: FullPollingListenerConfig) => PollingListenerBatchSizeStrategy;
//# sourceMappingURL=batch-size-strategy.d.ts.map