class

Crabbit::SuperStreamProducer

Inherits Reference < Object

Routes publishes across the current partitions of a RabbitMQ super stream.

Partition producers are created lazily and share SuperStreamProducerOptions#producer. Topology is refreshed on schedule and after routing failures.

Constructors

new(environment : Environment, super_stream : String, options : SuperStreamProducerOptions)

Creates a super-stream producer and resolves its initial topology.

Applications normally call Environment#super_stream_producer.

Source

Instance methods

close

Idempotently closes all partition producers.

Source
options

Returns routing and partition-producer options.

Source
publish(message : Message, routing_key : String | Nil = nil) : SuperStreamPublishHandle

Routes and publishes an AMQP message.

routing_key overrides SuperStreamProducerOptions#routing_key_extractor. A custom routing strategy ignores both values.

Source
publish(message : Message, routing_key : String | Nil = nil, &callback : Confirmation -> ) : SuperStreamPublishHandle

Routes and publishes an AMQP message, invoking the block for each selected partition's confirmation.

Source
publish(message : RawMessage | Bytes | String, routing_key : String) : SuperStreamPublishHandle

Routes and publishes raw, byte, or string payloads using an explicit key.

RawMessage is passed through; Bytes and String are wrapped in an AMQP Data section by the partition producer.

Source
super_stream

Returns the logical super-stream name.

Source