AMQPPool manages a pool of AMQP channels for you.
:ok = AMQPPool.Channel.with_channel(fn channel ->
AMQP.Basic.publish(channel, exchange, routing_key, payload)
end)
If available in Hex, the package can be installed
by adding amqp_pool
to your list of dependencies in mix.exs
:
def deps do
[
{:amqp_pool, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/amqp_pool.
# these are the same settings as for poolboy
config :amqp_pool, :pool_settings,
pool_size: 20,
max_overflow: 40
config :amqp_pool, :amqp_connection_settings,
username: "",
password: "",
host: "",
virtual_host: ""