Untitled notebook
# Tutorial: https://mkumm.com/posts/first-hops-with-rabbitmq
# TODO: amqp can't install on Elixir v1.17
Mix.install([
{:amqp, "~> 4.0"}
])
Section
options = [host: "localhost", port: 5675, virtual_host: "/", username: "guest", password: "guest"]
{:ok, connection} = AMQP.Connection.open(options)
{:ok, channel} = AMQP.Channel.open(connection)
AMQP.Queue.declare(channel, "sneakers")
AMQP.Basic.publish(channel, "", "sneakers", "Select sneakers")
AMQP.Basic.publish(channel, "", "sneakers", "too many sneakers")