【问题标题】:Problem connecting to Azure Service Bus using rabbitmq-amqp1.0-client使用 rabbitmq-amqp1.0-client 连接到 Azure 服务总线时出现问题
【发布时间】:2019-04-09 12:22:38
【问题描述】:

我正在尝试使用此 erlang 客户端连接 Azure 服务总线 (AMQP 1.0):https://github.com/rabbitmq/rabbitmq-amqp1.0-client

elixir 包装库https://github.com/pma/amqp 似乎不像使用 AMQP 1.0。所以我尝试直接使用erlang客户端。

我做了以下事情:

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

然后我根据https://github.com/rabbitmq/rabbitmq-amqp1.0-client 的 README 文件创建了一个配置

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}}.

当我尝试在自述文件中打开连接时,我收到以下错误。我无法遵循 erlang 错误消息。任何帮助表示赞赏。

{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)

【问题讨论】:

    标签: azure rabbitmq erlang amqp azureservicebus


    【解决方案1】:

    先尝试“启动”应用程序:

    application:ensure_all_started(amqp10_client).
    

    它抱怨找不到某个进程 (noproc),即名为 amqp10_client_sup 的进程。这个过程在应用程序启动时启动,由this piece of code

    -module(amqp10_client_app).
    
    -behaviour(application).
    
    -export([start/2,
             stop/1]).
    
    start(_Type, _Args) ->
        amqp10_client_sup:start_link().
    

    【讨论】:

    • application:start(amqp10_client). 给我{error,{not_started,ssl}}
    • 哎呀,试试application:ensure_all_started(amqp10_client).
    猜你喜欢
    • 1970-01-01
    • 2021-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-29
    • 2019-03-05
    • 1970-01-01
    • 2014-09-02
    相关资源
    最近更新 更多