lapin v0.2.0 Lapin.Channel View Source
Lapin Channel handling
Link to this section Summary
Types
Channel configuration
Consumer Prefetch
Consumer Tag
Exchange name
Queue name
Queue Arguments
Channel role
Routing key
Functions
Creates a channel from configuration
Find channel by consumer_tag
Find channel by exchange and routing key
Link to this section Types
Channel configuration
The following keys are supported:
role: channel role (
atom), allowed values are::consumer: Receives messages from the channel viaLapin.Connectioncallbacks:producer: Can publish messages to che channel:passive: Used to declare channel configuration, can’t receive nor publish
- pattern: channel pattern (module using the
Lapin.Patternbehaviour) - exchange: broker exchange (
String.t) - queue: broker queue (
String.t)
If using the Lapin.Pattern.Config default implementation, the following keys are also supported:
- consumer_ack: send consumer ack (boolean), default: false
- consumer_prefetch cosumer prefetch (integer | nil), default: nil
- exchange_type: declare type of the exchange (:direct, :fanout, :topic), default: :direct
- exchange_durable: declare exchange as durable (boolean), default: true
- publisher_confirm: expect RabbitMQ publish confirms (boolean), default: false
- publisher_mandatory: messages published as mandatory by default (boolean), deafault: false
- publisher_persistent: messages published as persistent by default (boolean), deafault: false
- queue_arguments: queue arguments (list of {string, type, value}), default: []
- queue_durable: declare queue as durable (boolean), default: true
- routing_key: routing_key for bindings (string), default: “”
Consumer Prefetch
Consumer Tag
Exchange name
Queue name
Queue Arguments
Channel role
Routing key
Link to this type
t()
View Source
t() :: %Lapin.Channel{amqp_channel: AMQP.Channel, config: config(), consumer_tag: consumer_tag(), exchange: exchange(), pattern: Lapin.Pattern.t(), queue: queue(), role: role(), routing_key: routing_key()}
Link to this section Functions
Link to this function
create(connection, config)
View Source
create(connection :: AMQP.Connection.t(), config()) :: t()
Creates a channel from configuration
Find channel by consumer_tag
Link to this function
get(channels, exchange, routing_key, role)
View Source
get([t()], exchange(), routing_key(), role()) :: t()
Find channel by exchange and routing key