Plugin for use Herald with AMQP protocol.
To use it, follow these steps:
Put in your mix.exs
and run mix deps.get
:
def deps do
[
# ... Another dependencies
{:herald, "~> 0.1"},
{:herald_amqp, "~> 0.1"}
]
end
Add amqp_url
in your configuration, as bellow:
config :herald,
amqp_url: "amqp://my.broker.url"
Case your prefer is to use environment variables, configure as bellow:
config :herald,
amqp_url: {:system, "AMQP_URL"}
In your application, find the file application.ex
, and put Herald.AMQP
in the children list, according the example bellow:
defmodule ExampleApp.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
# List all child processes to be supervised
children = [
{Herald.AMQP, []}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: ExampleApp.Supervisor]
Supervisor.start_link(children, opts)
end
end
Now, you only need follow the steps in your Quick Start guide and start with Herald!