class

Crabbit::ProducerOptions

Inherits Reference < Object

Configures publisher batching, confirms, filtering, backpressure, and recovery.

Constructors

new(name : String | Nil = nil, batch_size : Int32 = 100, sub_entry_size : Int32 = 1, compression : Compression = Compression::None, max_unconfirmed : Int32 = 10000, batch_delay : Time::Span = 100.milliseconds, confirm_timeout : Time::Span = 30.seconds, enqueue_timeout : Time::Span | Nil = nil, retry_on_recovery : Bool = true, filter_value_extractor : Proc(Message, String | Nil) | Nil = nil, recovery_policy : RecoveryPolicy = RecoveryPolicy.new, on_state_change : Proc(ResourceEvent, Nil) | Nil = nil)

Creates publisher options.

A non-nil name enables broker-side publishing-ID deduplication and sequence recovery. batch_size controls ordinary wire batching; sub_entry_size greater than one packs logical messages into compressed sub-entries. Filtering and sub-entry batching cannot be combined.

max_unconfirmed applies backpressure. With no enqueue_timeout, the publishing fiber waits indefinitely for capacity. confirm_timeout limits how long an unresolved publish remains pending. When retry_on_recovery is true, pending messages are sent again after the publisher reconnects.

Source

Instance methods

batch_delay

Returns how long the batch worker waits for more messages.

Source
batch_size

Returns the maximum number of logical messages collected per wire batch.

Source
compression

Returns the compression used for sub-entry batches.

Source
confirm_timeout

Returns the default publisher-confirmation timeout.

Source
enqueue_timeout

Returns the optional timeout for waiting on backpressure capacity.

Source
filter_value_extractor

Returns the optional server-side filter value extractor.

Source
max_unconfirmed

Returns the hard limit of publishes awaiting confirmation.

Source
name

Returns the optional publisher reference used for broker deduplication.

Source
on_state_change

Returns the optional asynchronous lifecycle listener.

Source
recovery_policy

Returns the reconnect backoff policy.

Source
retry_on_recovery

Returns whether unresolved messages are republished after recovery.

Source
sub_entry_size

Returns the number of logical messages packed into each sub-entry.

Source