class Crabbit::SuperStreamProducerOptions

Overview

Configures a SuperStreamProducer and its partition routing.

Defined in:

crabbit/options.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(routing_key_extractor : Proc(Message, String) | Nil = nil, routing : SuperStreamRouting = SuperStreamRouting::Hash, producer : ProducerOptions = ProducerOptions.new, hash_function : Proc(String, UInt32) | Nil = nil, routing_strategy : Proc(Message, Array(String), Array(String)) | Nil = nil, topology_refresh : Time::Span = 30.seconds) #

Creates super-stream producer options.

Supply either routing_key_extractor or routing_strategy. A custom strategy receives the message and current partition names and may return one or more of those partitions. When using SuperStreamRouting::Hash, hash_function can replace the RabbitMQ-compatible default.


[View source]

Instance Method Detail

def hash_function : Proc(String, UInt32) | Nil #

Returns the optional custom hash function.


[View source]
def producer : ProducerOptions #

Returns options shared by every partition producer.


[View source]
def routing : SuperStreamRouting #

Returns the built-in routing mode.


[View source]
def routing_key_extractor : Proc(Message, String) | Nil #

Returns the routing-key extractor used by built-in routing.


[View source]
def routing_strategy : Proc(Message, Array(String), Array(String)) | Nil #

Returns the optional custom partition-selection strategy.


[View source]
def topology_refresh : Time::Span #

Returns how often cached topology may be refreshed.


[View source]