Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Untitled notebook

rabbit_mq.livemd

Untitled notebook

# Tutorial: https://mkumm.com/posts/first-hops-with-rabbitmq
# TODO: amqp can't install on Elixir v1.17
Mix.install([
  {:amqp, "~> 3.3"}
])

Section

options = [host: "localhost", port: 5675, virtual_host: "/", username: "guest", password: "guest"]
{:ok, connection} = AMQP.Connection.open(optionshttps://mkumm.com/posts/first-hops-with-rabbitmq/#feedback)
{: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")