lapin v0.3.5 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
Link to this type
config()
View Source
config()
View Source
config() :: Keyword.t()
config() :: Keyword.t()
Channel configuration
The following keys are supported:
role: channel role (
atom
), allowed values are::consumer
: Receives messages from the channel viaLapin.Connection
callbacks: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.Pattern
behaviour) - 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: ""
Link to this type
consumer_prefetch()
View Source
consumer_prefetch()
View Source
consumer_prefetch() :: Integer.t() | nil
consumer_prefetch() :: Integer.t() | nil
Consumer Prefetch
Link to this type
consumer_tag()
View Source
consumer_tag()
View Source
consumer_tag() :: String.t()
consumer_tag() :: String.t()
Consumer Tag
Link to this type
exchange()
View Source
exchange()
View Source
exchange() :: String.t()
exchange() :: String.t()
Exchange name
Link to this type
queue()
View Source
queue()
View Source
queue() :: String.t()
queue() :: String.t()
Queue name
Link to this type
queue_arguments() View Source
Queue Arguments
Link to this type
role()
View Source
role()
View Source
role() :: :consumer | :producer | :passive
role() :: :consumer | :producer | :passive
Channel role
Link to this type
routing_key()
View Source
routing_key()
View Source
routing_key() :: String.t()
routing_key() :: String.t()
Routing key
Link to this type
t()
View Source
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()
}
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, config)
View Source
create(connection :: AMQP.Connection.t(), config()) :: t()
create(connection :: AMQP.Connection.t(), config()) :: t()
Creates a channel from configuration
Link to this function
get(channels, consumer_tag)
View Source
get(channels, consumer_tag)
View Source
get([t()], consumer_tag()) :: t()
get([t()], consumer_tag()) :: t()
Find channel by consumer_tag
Link to this function
get(channels, exchange, routing_key, role)
View Source
get(channels, exchange, routing_key, role)
View Source
get([t()], exchange(), routing_key(), role()) :: t()
get([t()], exchange(), routing_key(), role()) :: t()
Find channel by exchange and routing key