Skip to content

Latest commit

 

History

History
 
 

elixir

Elixir code for RabbitMQ tutorials

Here you can find an Elixir port of RabbitMQ tutorials.

Requirements

To run this code you need a recent Elixir version installed, which should include Mix, the Elixir build tool.

These tutorials use Elixir AMQP 0-9-1 client built on top of the official RabbitMQ Erlang client.

To install dependencies with Mix, run

mix deps.get
mix deps.compile

Code

To run the examples, use mix run.

Tutorial one: "Hello World!":

mix run receive.exs
mix run send.exs

Tutorial two: Work Queues

mix run worker.exs
mix run new_task.exs

Tutorial three: Publish/Subscribe

mix run receive_logs.exs
mix run emit_log.exs

Tutorial four: Routing

mix run receive_logs_direct.exs --info --warning
mix run emit_log_direct.exs --info "A message"

Tutorial five: Topics

mix run receive_logs_topic.exs "info.*" "warn.*"
mix run emit_log_topic.exs "info.connections" "Connected"

Tutorial six: RPC (Request/Response)

mix run rpc_server.exs
mix run rpc_client.exs