1

i am using ActiveMQ as message broker and used Qpid proton c library to connect to Erlang for messaging service and seems working well with below commands with ActiveMQ running.

qpidpn:subscribe("amqp://127.0.0.1/topic://destination").
qpidpn:publish(#{address => "amqp://127.0.0.1/topic://destination", body => "hello"}).
flush().
qpidpn:stop().
q().

I need to write a module in elixir to connect to the ActiveMQ broker same as done in erlang above. Erlang is though connected to message broker service using qpid library. Please suggest.

Jos
  • 33
  • 2

1 Answers1

1

I haven't tried out the code below but calling an Erlang lib from Elixir is pretty trivial.

Try this:

:qpidpn.subscribe("amqp://127.0.0.1/topic://destination")
:qpidpn.publish(%{:address => "amqp://127.0.0.1/topic://destination", :body => "hello"})
:flush()
:qpidpn.stop()
:q()

As I say, I haven't tried it (and can't because I don't have amqp or qpidn installed) but that may be along the lines of what you're looking for.

Onorio Catenacci
  • 14,928
  • 14
  • 81
  • 132