Shared virtual channel operations (kombu.transport.virtual.base.Channel).
Provides message envelope preparation, base64 body encoding/decoding, priority clamping, exchange/queue/binding state transitions, and routing table lookup.
Summary
Functions
Augments a prepared message envelope with body_encoding, delivery_tag,
and delivery_info (exchange, routing_key).
Decodes body using encoding ("base64" or "utf-8" / nil).
Encodes body using encoding ("base64" or "utf-8" / nil).
Returns {encoded_body, encoding}.
Declares an exchange in %BrokerState{}.
Raises Kombu.ChannelError if passive: true and the exchange does not exist,
or Kombu.NotEquivalentError if redeclared with incompatible attributes.
Raises Kombu.NotImplementedError for unsupported flow/1 on virtual channels.
Extracts and clamps the integer priority (0..9) from message["properties"]["priority"].
If reverse: true, returns max_priority - priority (so priority 9 becomes 0 for Redis keys).
Lists all {queue, exchange, routing_key} bindings in %BrokerState{}.
Looks up all queues matching routing_key for exchange in %BrokerState{}.
Converts a raw message map into a %Kombu.Message{} bound to channel.
Prepares a message envelope map before publishing (Channel.prepare_message).
Binds queue to exchange with routing_key in %BrokerState{}.
Returns {meta_tuple, updated_broker_state}.
Unbinds queue from exchange with routing_key in %BrokerState{}.
Functions
Augments a prepared message envelope with body_encoding, delivery_tag,
and delivery_info (exchange, routing_key).
Decodes body using encoding ("base64" or "utf-8" / nil).
Encodes body using encoding ("base64" or "utf-8" / nil).
Returns {encoded_body, encoding}.
@spec exchange_declare( Kombu.Transport.Virtual.BrokerState.t(), String.t() | nil, keyword() ) :: {:ok, Kombu.Transport.Virtual.BrokerState.t()}
Declares an exchange in %BrokerState{}.
Raises Kombu.ChannelError if passive: true and the exchange does not exist,
or Kombu.NotEquivalentError if redeclared with incompatible attributes.
Raises Kombu.NotImplementedError for unsupported flow/1 on virtual channels.
Extracts and clamps the integer priority (0..9) from message["properties"]["priority"].
If reverse: true, returns max_priority - priority (so priority 9 becomes 0 for Redis keys).
@spec list_bindings(Kombu.Transport.Virtual.BrokerState.t()) :: [ {String.t(), String.t(), String.t()} ]
Lists all {queue, exchange, routing_key} bindings in %BrokerState{}.
@spec lookup( Kombu.Transport.Virtual.BrokerState.t(), String.t() | nil, String.t() | nil, String.t() | nil ) :: [String.t()]
Looks up all queues matching routing_key for exchange in %BrokerState{}.
@spec message_to_python(map() | Kombu.Message.t(), term()) :: Kombu.Message.t()
Converts a raw message map into a %Kombu.Message{} bound to channel.
Prepares a message envelope map before publishing (Channel.prepare_message).
@spec queue_bind( Kombu.Transport.Virtual.BrokerState.t(), String.t(), String.t() | nil, String.t() | nil, keyword() ) :: {{String.t(), String.t(), String.t()}, Kombu.Transport.Virtual.BrokerState.t()}
Binds queue to exchange with routing_key in %BrokerState{}.
Returns {meta_tuple, updated_broker_state}.
@spec queue_unbind( Kombu.Transport.Virtual.BrokerState.t(), String.t(), String.t() | nil, String.t() | nil, keyword() ) :: Kombu.Transport.Virtual.BrokerState.t()
Unbinds queue from exchange with routing_key in %BrokerState{}.