Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.
/ amqp_pool Public archive
forked from derekkraan/amqp_pool

AMQPPool manages an AMQP connection pool.

Notifications You must be signed in to change notification settings

bluelabs-eu/amqp_pool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMQPPool

AMQPPool manages a pool of AMQP channels for you.

Usage

:ok = AMQPPool.Channel.with_channel(:my_pool,
        # main function
        fn channel ->
          AMQP.Basic.publish(channel, exchange, routing_key, payload)
        end,
        # setup
        fn channel ->
          :ok = AMQP.Exchange.declare(channel, exchange_name, exchange_type, exchange_opts)
          {:ok, channel}
        end
      )

Installation

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.

Configuration

config :amqp_pool, pools: [:my_pool]

# these are the same settings as for poolboy
config :amqp_pool, :my_pool,
  pool_size: 5,
  max_overflow: 2

config :amqp_pool, my_pool_username: "USERNAME"
config :amqp_pool, my_pool_password: "PASSWORD"
config :amqp_pool, my_pool_vhost: "VHOST"
config :amqp_pool, my_pool_host: "HOST"
config :amqp_pool, my_pool_host: 5672

The details of the AMQP endpoint can also be provided using environment variables using the <pool-name-in-all-caps>_<parameter> format (e.g. MY_POOL_USERNAME="USERNAME").

About

AMQPPool manages an AMQP connection pool.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%