Redis virtual channel (kombu.transport.redis.Channel).
Implements Kombu's Redis broker protocol:
- Priority queues (
priority_steps = [0, 3, 6, 9]) with(<<6, 22>>) separator - Exchange binding sets (
_kombu.binding.<exchange>,_kombu.binding_permanent.<exchange>,_kombu.binding_deadlines) - Fanout Pub/Sub (
/{db}.<exchange>) - Ack emulation via
Kombu.Transport.Redis.QoS(unacked,unacked_index,unacked_mutex) - Queue expiration (
x-expires) and binding deadline refresh/sweep Lua scripts - Batched publishing via
Kombu.Transport.Redis.PublishBatch
Summary
Functions
Returns a specification to start this module under a supervisor.
Restores a raw message payload to its destination queue(s) in Redis, marking redelivered = true.
If leftmost is true, pushes via LPUSH; otherwise pushes via RPUSH (matching redis.py).
Determines the exchange type for exchange.
Returns PEXPIRE commands for all priority keys of queue if x-expires is set.
Pops a message from queue by checking priority buckets [0, 3, 6, 9] in order via RPOP.
Returns {:ok, raw_message_map} or :empty.
Returns the Pub/Sub topic for publishing to a fanout exchange.
Returns the Pub/Sub topic pattern for subscribing to fanout queue.
Fetches the routing table [{routing_key, pattern, queue}] for exchange from Redis.
Checks whether any priority list for queue exists in Redis (EXISTS pipeline).
Looks up matching destination queues for (exchange, routing_key) by querying Redis SMEMBERS.
Looks up matching destination queues for (exchange, routing_key) given table.
Computes the clamped message priority for queue, respecting x-max-priority if configured.
Creates a %Kombu.Transport.Redis.Channel{} state struct directly (useful in unit tests).
Maps an integer priority n (0..9) to its priority step bucket ([0, 3, 6, 9]).
Purges all priority lists for queue (LLEN + DEL pipeline) and returns the number of removed messages.
Pushes message (raw map) into queue at its priority bucket in Redis.
Publishes a fanout message (raw map) to the Redis Pub/Sub topic for exchange.
Returns the Redis list key for queue at priority pri.
Priority 0 uses queue; non-zero step uses "#{queue}\x06\x16#{step}".
Returns the total length of queue across all priority steps (LLEN pipeline).
Strips any <pri> suffix from a Redis queue key.
Types
@type t() :: %Kombu.Transport.Redis.Channel{ ack_emulation: term(), active_fanout_queues: term(), active_queues: term(), auto_delete_queues: term(), binding_expiry_refreshed_at: term(), bindings_swept_at: term(), body_encoding: term(), broker_state: term(), channel_id: term(), client: term(), closed: term(), consumers: term(), deadletter_queue: term(), do_restore: term(), expires: term(), fanout_buffer: term(), fanout_patterns: term(), fanout_prefix: term(), fanout_queues: term(), fanout_to_queue: term(), global_keyprefix: term(), keyprefix_binding_deadlines: term(), keyprefix_binding_permanent: term(), keyprefix_fanout: term(), keyprefix_queue: term(), max_priorities: term(), no_ack_consumers: term(), priority_steps: term(), qos: term(), queue_cycle: term(), queue_order_strategy: term(), sep: term(), virtual_host: term() }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Restores a raw message payload to its destination queue(s) in Redis, marking redelivered = true.
If leftmost is true, pushes via LPUSH; otherwise pushes via RPUSH (matching redis.py).
Determines the exchange type for exchange.
Returns PEXPIRE commands for all priority keys of queue if x-expires is set.
Pops a message from queue by checking priority buckets [0, 3, 6, 9] in order via RPOP.
Returns {:ok, raw_message_map} or :empty.
Returns the Pub/Sub topic for publishing to a fanout exchange.
Returns the Pub/Sub topic pattern for subscribing to fanout queue.
Fetches the routing table [{routing_key, pattern, queue}] for exchange from Redis.
Checks whether any priority list for queue exists in Redis (EXISTS pipeline).
Looks up matching destination queues for (exchange, routing_key) by querying Redis SMEMBERS.
Looks up matching destination queues for (exchange, routing_key) given table.
Computes the clamped message priority for queue, respecting x-max-priority if configured.
Creates a %Kombu.Transport.Redis.Channel{} state struct directly (useful in unit tests).
Maps an integer priority n (0..9) to its priority step bucket ([0, 3, 6, 9]).
Purges all priority lists for queue (LLEN + DEL pipeline) and returns the number of removed messages.
Pushes message (raw map) into queue at its priority bucket in Redis.
Publishes a fanout message (raw map) to the Redis Pub/Sub topic for exchange.
Returns the Redis list key for queue at priority pri.
Priority 0 uses queue; non-zero step uses "#{queue}\x06\x16#{step}".
Returns the total length of queue across all priority steps (LLEN pipeline).
Strips any <pri> suffix from a Redis queue key.