shankardevy
shankardevy

Reputation: 4370

Problem connecting to Azure Service Bus using rabbitmq-amqp1.0-client

I'm trying to connect Azure Service Bus (AMQP 1.0) using this erlang client: https://github.com/rabbitmq/rabbitmq-amqp1.0-client

The elixir wrapper library https://github.com/pma/amqp doesn't seem like using AMQP 1.0. So I'm trying to use the erlang client directly.

I did the following:

git clone https://github.com/rabbitmq/rabbitmq-amqp1.0-client.git
cd rabbitmq-amqp1.0-client
make
make shell

Then I created a config as per the README file at https://github.com/rabbitmq/rabbitmq-amqp1.0-client

OpnConf = #{address => Hostname,
            port => Port,
            hostname => <<"abc-shankardevy.servicebus.windows.net">>,
            tls_opts => {secure_port, [{versions, ['tlsv1.1']}]},
            container_id => <<"test-container">>,
            transfer_limit_margin => 100,
            sasl => {plain, User, Password}}.

When I try to open the connection as in the README, I get the following error. I'm not able to follow the erlang error message. Any help is appreciated.

{ok, Connection} = amqp10_client:open_connection(OpnConf).
** exception exit: {noproc,{gen_server,call,
                                       [amqp10_client_sup,
                                        {start_child,[#{address =>
                                                            'abc-shankardevy.servicebus.windows.net',
                                                        container_id => <<"test-container">>,
                                                        hostname => <<"abc-shankardevy.servicebus.windows.net">>,
                                                        notify => <0.111.0>,port => 5671,
                                                        sasl =>
                                                            {plain,'RootManageSharedAccessKey',
                                                                   'mykey'},
                                                        tls_opts => {secure_port,[{versions,['tlsv1.1']}]},
                                                        transfer_limit_margin => 100}]},
                                        infinity]}}
     in function  gen_server:call/3 (gen_server.erl, line 223)
     in call from amqp10_client_connection:open/1 (src/amqp10_client_connection.erl, line 110)

Upvotes: 0

Views: 964

Answers (1)

legoscia
legoscia

Reputation: 41527

Try "starting" the application first:

application:ensure_all_started(amqp10_client).

It's complaining about not finding a certain process (noproc), namely the one called amqp10_client_sup. This process is started when the application is started, by this piece of code:

-module(amqp10_client_app).

-behaviour(application).

-export([start/2,
         stop/1]).

start(_Type, _Args) ->
    amqp10_client_sup:start_link().

Upvotes: 1

Related Questions