Interface ConsumerOptions<TMessage>

interface ConsumerOptions<TMessage extends WithOptionalObjectId> {
    concurrency?: number;
    fastPollMs?: number;
    filter?: Filter<TMessage>;
    group?: string;
    maxRetries?: number;
    maxVisibilitySeconds?: number;
    pollMs?: number;
    visibilityDelaySeconds?: number;
    visibilityTimeoutSeconds?: number;
}

Type Parameters

Hierarchy (View Summary)

Properties

concurrency?: number

Maximum number of messages to be consumed concurrently for this Consumer. Defaults to 1.

fastPollMs?: number

Maximum follow-up polling delay in milliseconds. Consumers will fast-poll while concurrency is not reached, and after a message is successfully consumed. Defaults to 10 milliseconds.

filter?: Filter<TMessage>

MongoDB filter for messages to be consumed.

group?: string

Consumer group. Defaults to the collection name.

maxRetries?: number

Maximum number of retries per message. Defaults to 1.

maxVisibilitySeconds?: number

Maximum number of seconds to poll for past messages to consume. Defaults to 3600 seconds (1 hour).

pollMs?: number

Polling interval in milliseconds. Defaults to 1000 milliseconds.

visibilityDelaySeconds?: number

Minimum number of seconds before a published message may be consumed. Defaults to zero.

visibilityTimeoutSeconds?: number

Minimum number of seconds to hide messages from other consumers after receiving. Set at least to 2x of the maximum workload time for message consumption. Defaults to 2 seconds.