
Prior to this commit, the RabbitMQ tutorials contained no Elixir examples. One _could_ look at the Erlang examples and adapt them, but that certainly does not result in idiomatic Elixir. This commit adds the first tutorial and an Elixir project file specifying the `amqp` library as the dependency for communicating with RabbitMQ via idiomatic Elixir.
7 lines
251 B
Elixir
7 lines
251 B
Elixir
{:ok, connection} = AMQP.Connection.open
|
|
{:ok, channel} = AMQP.Channel.open(connection)
|
|
AMQP.Queue.declare(channel, "hello")
|
|
AMQP.Basic.publish(channel, "", "hello", "Hello World!")
|
|
IO.puts " [x] Sent 'Hello World!'"
|
|
AMQP.Connection.close(connection)
|