How can I send JSON to consumer using RabbitMQ and Elixir? -
i trying send json consumer rabbitmq? possible , how? using elixir programming language.
follow link : https://github.com/pma/amqp
open issues more information send json.
iex(1)> {:ok, conn} = amqp.connection.open {:ok, %amqp.connection{pid: #pid<0.364.0>}} iex(2)> {:ok, chan} = amqp.channel.open(conn) {:ok, %amqp.channel{conn: %amqp.connection{pid: #pid<0.364.0>}, pid: #pid<0.376.0>}} iex(3)> amqp.queue.declare chan, "test_queue" {:ok, %{consumer_count: 0, message_count: 0, queue: "test_queue"}} iex(4)> amqp.exchange.declare chan, "test_exchange" :ok iex(5)> amqp.queue.bind chan, "test_queue", "test_exchange" :ok iex(6)> amqp.basic.publish(chan, "test_exchange", "", poison.encode(%{ name: "s" }), [content_type: "application/json"]) :ok
Comments
Post a Comment