class
Crabbit::SuperStreamProducerOptions
- Crabbit::SuperStreamProducerOptions
- Reference
- Object
Overview
Configures a SuperStreamProducer and its partition routing.
Defined in:
crabbit/options.crConstructors
-
.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.
Instance Method Summary
-
#hash_function : Proc(String, UInt32) | Nil
Returns the optional custom hash function.
-
#producer : ProducerOptions
Returns options shared by every partition producer.
-
#routing : SuperStreamRouting
Returns the built-in routing mode.
-
#routing_key_extractor : Proc(Message, String) | Nil
Returns the routing-key extractor used by built-in routing.
-
#routing_strategy : Proc(Message, Array(String), Array(String)) | Nil
Returns the optional custom partition-selection strategy.
-
#topology_refresh : Time::Span
Returns how often cached topology may be refreshed.
Constructor Detail
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.
Instance Method Detail
Returns the routing-key extractor used by built-in routing.
Returns the optional custom partition-selection strategy.