Giter Site home page Giter Site logo

rabbitmq-management-exchange's Introduction

RabbitMQ Management Exchange Type

This plugin provides a (slightly hackish) mechanism for making requests to the RabbitMQ Management API while talking AMQP. In essence, it allows you to publish messages to a special exchange type, which then makes an HTTP request to localhost, and publishes the response to a reply queue.

It currently has one notable limitation: the user name and password for the HTTP request are taken from your configuration file rather than the AMQP connection. If there is sufficient interest in this plugin, we'll work to remove this limitation.

Installation

Install the corresponding .ez files from our Community Plugins page.

After installing, enable it with the following command:

rabbitmq-plugins enable rabbitmq_management_exchange

Usage

Declare an exchange of type x-management. Declare a reply queue (of any name). Then publish requests to your new exchange. The exchange will accept the requests and publish responses to your reply queue.

The format of a request message is:

  • Query path (e.g. "/overview") in the routing key.
  • Reply queue name in the 'reply_to' property.
  • HTTP method (e.g. "GET") in the 'type' property.
  • JSON body (if there is one) in the message payload.

The format of a reply message is:

  • Reply queue name in the routing key.
  • HTTP response code (e.g. "200") in the 'type' property.
  • JSON response (if there is one) in the message payload.

If you set a correlation-id in the request, it will be preserved in the response.

Since the exchange accepts requests itself it does not need to be bound to any queue (and indeed it's an error to do so). This means that if you publish to the exchange with "mandatory" set, your message will be returned as unrouted - since it did not go to any queue.

Configuration

It is possible to configure the plugin to use a non-default user to authenticate HTTP API requests:

[
  {rabbitmq_management_exchange, [{username, "my-username"},
                                  {password, "my-password"}]}
].

If the above section is skipped, guest/guest will be used.

See RabbitMQ configuration guide for details.

Examples

There is a usage example using the Java client in examples/java. See also the test/src directory for a simple test using the Erlang client.

Building from Source

Build it like any other plugin. See Plugin Development.

Creating a Release

  1. Update broker_version_requirements in helpers.bzl & Makefile (Optional)
  2. Update the plugin version in MODULE.bazel
  3. Push a tag (i.e. v3.12.0) with the matching version
  4. Allow the Release workflow to run and create a draft release
  5. Review and publish the release

rabbitmq-management-exchange's People

Contributors

acogoluegnes avatar camelpunch avatar dcorbacho avatar dumbbell avatar gerhard avatar kjnilsson avatar lukebakken avatar michaelklishin avatar pjk25 avatar spring-operator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rabbitmq-management-exchange's Issues

URI passed to httpc:request/5 can fail to parse on OTP 21

I can't share much of this because it's all private, but here's a crash:

 {function_clause,
    [{uri_string,parse,
         [{error,invalid_uri,":"}],
         [{file,"uri_string.erl"},{line,337}]},
     {httpc,request,5,[{file,"httpc.erl"},{line,179}]},
     {rabbit_exchange_type_management,handle_rpc,6,
         [{file,"src/rabbit_exchange_type_management.erl"},{line,90}]},
     {rabbit_exchange_type_management,'-route/2-lc$^0/1-0-',6,
         [{file,"src/rabbit_exchange_type_management.erl"},{line,61}]},
     {rabbit_exchange_type_management,route,2,
         [{file,"src/rabbit_exchange_type_management.erl"},{line,61}]},
     {rabbit_exchange,route1,3,[{file,"src/rabbit_exchange.erl"},{line,397}]},
     {rabbit_exchange,route,2,[{file,"src/rabbit_exchange.erl"},{line,387}]},
     {rabbit_channel,handle_method,3,
         [{file,"src/rabbit_channel.erl"},{line,1138}]}]}

If you use OTP 21 and use this exchange, the reply crashes due to something with the internal URI.

Publishing over HTTP API fails with a function_clause

I tried the official docker distribution for 3.6.6 and the matching plugin

I tried a basic request by publishing a message in this exchange using the management interface

call to the api using curl from a shell running inside the container

root@my-rabbit:/# curl -i -u guest:guest http://localhost:15672/api/overview
HTTP/1.1 200 OK
vary: Accept-Encoding, origin
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Thu, 26 Jan 2017 08:10:56 GMT
Content-Type: application/json
Content-Length: 1808
Cache-Control: no-cache

{"management_version":"3.6.6","rates_mode":"basic","exchange_types":[{"name":"fanout","description":"AMQP fanout exchange, as per the AMQP specification","enabled":true},{"name":"headers","description":"AMQP headers exchange, as per the AMQP specification","enabled":true},{"name":"x-management","description":"Management Exchange","enabled":true},{"name":"direct","description":"AMQP direct exchange, as per the AMQP specification","enabled":true},{"name":"topic","description":"AMQP topic exchange, as per the AMQP specification","enabled":true}],"rabbitmq_version":"3.6.6","cluster_name":"rabbit@my-rabbit","erlang_version":"19.2","erlang_full_version":"Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:2:2] [async-threads:64] [hipe] [kernel-poll:true]","message_stats":{"publish":1,"publish_details":{"rate":0.0},"publish_in":0,"publish_in_details":{"rate":0.0},"publish_out":0,"publish_out_details":{"rate":0.0},"ack":0,"ack_details":{"rate":0.0},"deliver_get":0,"deliver_get_details":{"rate":0.0},"confirm":1,"confirm_details":{"rate":0.0},"return_unroutable":1,"return_unroutable_details":{"rate":0.0},"redeliver":0,"redeliver_details":{"rate":0.0}},"queue_totals":{"messages":0,"messages_details":{"rate":0.0},"messages_ready":0,"messages_ready_details":{"rate":0.0},"messages_unacknowledged":0,"messages_unacknowledged_details":{"rate":0.0}},"object_totals":{"consumers":0,"queues":1,"exchanges":9,"connections":0,"channels":0},"statistics_db_event_queue":0,"node":"rabbit@my-rabbit","statistics_db_node":"rabbit@my-rabbit","listeners":[{"node":"rabbit@my-rabbit","protocol":"amqp","ip_address":"::","port":5672},{"node":"rabbit@my-rabbit","protocol":"clustering","ip_address":"::","port":25672}],"contexts":[{"node":"rabbit@my-rabbit","description":"RabbitMQ Management","path":"/","port":"15672"}]}

error when publishing a message

=ERROR REPORT==== 26-Jan-2017::08:06:26 ===
** Generic server <0.1339.0> terminating
** Last message in was {'$gen_cast',
                           {method,
                               {'basic.publish',0,<<"management">>,
                                   <<"/overview">>,true,false},
                               {content,60,
                                   {'P_basic',undefined,undefined,[],1,
                                       undefined,undefined,undefined,
                                       undefined,undefined,undefined,
                                       <<"GET">>,undefined,undefined,
                                       undefined},
                                   none,none,
                                   [<<" ">>]},
                               noflow}}
** When Server state == {ch,running,rabbit_framing_amqp_0_9_1,1,<0.1336.0>,
                            <0.1336.0>,<0.1330.0>,
                            <<"<[email protected]>">>,
                            {lstate,<0.1338.0>,false},
                            none,1,
                            {[],[]},
                            {user,<<"guest">>,
                                [administrator],
                                [{rabbit_auth_backend_internal,none}]},
                            <<"/">>,<<>>,
                            {dict,0,16,16,8,80,48,
                                {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 []},
                                {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                  [],[]}}},
                            {state,
                                {dict,0,16,16,8,80,48,
                                    {[],[],[],[],[],[],[],[],[],[],[],[],[],
                                     [],[],[]},
                                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],
                                      [],[],[]}}},
                                erlang},
                            {dict,0,16,16,8,80,48,
                                {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 []},
                                {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                  [],[]}}},
                            {dict,0,16,16,8,80,48,
                                {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 []},
                                {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                  [],[]}}},
                            {set,0,16,16,8,80,48,
                                {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 []},
                                {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                  [],[]}}},
                            <0.1333.0>,
                            {state,fine,5000,#Ref<0.0.2.439>},
                            true,1,
                            {{0,nil},{0,nil}},
                            [],
                            {{0,nil},{0,nil}},
                            [{<<"publisher_confirms">>,bool,true},
                             {<<"exchange_exchange_bindings">>,bool,true},
                             {<<"basic.nack">>,bool,true},
                             {<<"consumer_cancel_notify">>,bool,true},
                             {<<"connection.blocked">>,bool,true},
                             {<<"authentication_failure_close">>,bool,true}],
                            none,0,none,flow,[]}
** Reason for termination == 
** {function_clause,
       [{httpc,request,
            [get,
             {"http://localhost:15672/api/overview",
              [{"Authorization","Basic Z3Vlc3Q6Z3Vlc3Q="}],
              "application/json",<<" ">>},
             [{version,"HTTP/1.0"}],
             [],default],
            [{file,"httpc.erl"},{line,149}]},
        {rabbit_exchange_type_management,handle_rpc,6,
            [{file,"src/rabbit_exchange_type_management.erl"},{line,85}]},
        {rabbit_exchange_type_management,'-route/2-lc$^0/1-0-',6,
            [{file,"src/rabbit_exchange_type_management.erl"},{line,61}]},
        {rabbit_exchange_type_management,route,2,
            [{file,"src/rabbit_exchange_type_management.erl"},{line,61}]},
        {rabbit_exchange,route1,3,
            [{file,"src/rabbit_exchange.erl"},{line,381}]},
        {rabbit_exchange,route,2,
            [{file,"src/rabbit_exchange.erl"},{line,371}]},
        {rabbit_channel,handle_method,3,
            [{file,"src/rabbit_channel.erl"},{line,949}]},
        {rabbit_channel,handle_cast,2,
            [{file,"src/rabbit_channel.erl"},{line,457}]}]}

=CRASH REPORT==== 26-Jan-2017::08:06:26 ===
  crasher:
    initial call: rabbit_channel:init/1
    pid: <0.1339.0>
    registered_name: []
    exception exit: {function_clause,
                        [{httpc,request,
                             [get,
                              {"http://localhost:15672/api/overview",
                               [{"Authorization","Basic Z3Vlc3Q6Z3Vlc3Q="}],
                               "application/json",<<" ">>},
                              [{version,"HTTP/1.0"}],
                              [],default],
                             [{file,"httpc.erl"},{line,149}]},
                         {rabbit_exchange_type_management,handle_rpc,6,
                             [{file,"src/rabbit_exchange_type_management.erl"},
                              {line,85}]},
                         {rabbit_exchange_type_management,
                             '-route/2-lc$^0/1-0-',6,
                             [{file,"src/rabbit_exchange_type_management.erl"},
                              {line,61}]},
                         {rabbit_exchange_type_management,route,2,
                             [{file,"src/rabbit_exchange_type_management.erl"},
                              {line,61}]},
                         {rabbit_exchange,route1,3,
                             [{file,"src/rabbit_exchange.erl"},{line,381}]},
                         {rabbit_exchange,route,2,
                             [{file,"src/rabbit_exchange.erl"},{line,371}]},
                         {rabbit_channel,handle_method,3,
                             [{file,"src/rabbit_channel.erl"},{line,949}]},
                         {rabbit_channel,handle_cast,2,
                             [{file,"src/rabbit_channel.erl"},{line,457}]}]}
      in function  gen_server2:terminate/3 (src/gen_server2.erl, line 1143)
    ancestors: [<0.1337.0>,rabbit_direct_client_sup,rabbit_sup,<0.100.0>]
    messages: []
    links: [<0.1337.0>,<0.1336.0>]
    dictionary: [{{xtype_to_module,'x-management'},
                   rabbit_exchange_type_management},
                  {process_name,
                      {rabbit_channel,{<<"<[email protected]>">>,1}}},
                  {permission_cache,
                      [{{resource,<<"/">>,exchange,<<"management">>},write}]},
                  {channel_operation_timeout,15000},
                  {rand_seed,
                      {#{max => 288230376151711743,
                         next => #Fun<rand.8.41921595>,
                         type => exsplus,
                         uniform => #Fun<rand.9.41921595>,
                         uniform_n => #Fun<rand.10.41921595>},
                       [270005699070726862|162271207340813698]}},
                  {guid,{{3083311114,4043970332,1041683654,998559032},0}},
                  {msg_size_for_gc,1}]
    trap_exit: true
    status: running
    heap_size: 2586
    stack_size: 27
    reductions: 1859
  neighbours:
    neighbour: [{pid,<0.1336.0>},
                  {registered_name,[]},
                  {initial_call,{amqp_channel,init,['Argument__1']}},
                  {current_function,{gen_server,loop,6}},
                  {ancestors,
                      [<0.1334.0>,<0.1331.0>,<0.1329.0>,<0.1328.0>,amqp_sup,
                       <0.356.0>]},
                  {messages,[]},
                  {links,[<0.1334.0>,<0.1339.0>]},
                  {dictionary,
                      [{process_name,
                           {amqp_channel,
                               {<<"<[email protected]>">>,1}}}]},
                  {trap_exit,false},
                  {status,waiting},
                  {heap_size,610},
                  {stack_size,9},
                  {reductions,198}]

=SUPERVISOR REPORT==== 26-Jan-2017::08:06:26 ===
     Supervisor: {<0.1334.0>,amqp_channel_sup}
     Context:    child_terminated
     Reason:     {function_clause,
                     [{httpc,request,
                          [get,
                           {"http://localhost:15672/api/overview",
                            [{"Authorization","Basic Z3Vlc3Q6Z3Vlc3Q="}],
                            "application/json",<<" ">>},
                           [{version,"HTTP/1.0"}],
                           [],default],
                          [{file,"httpc.erl"},{line,149}]},
                      {rabbit_exchange_type_management,handle_rpc,6,
                          [{file,"src/rabbit_exchange_type_management.erl"},
                           {line,85}]},
                      {rabbit_exchange_type_management,'-route/2-lc$^0/1-0-',
                          6,
                          [{file,"src/rabbit_exchange_type_management.erl"},
                           {line,61}]},
                      {rabbit_exchange_type_management,route,2,
                          [{file,"src/rabbit_exchange_type_management.erl"},
                           {line,61}]},
                      {rabbit_exchange,route1,3,
                          [{file,"src/rabbit_exchange.erl"},{line,381}]},
                      {rabbit_exchange,route,2,
                          [{file,"src/rabbit_exchange.erl"},{line,371}]},
                      {rabbit_channel,handle_method,3,
                          [{file,"src/rabbit_channel.erl"},{line,949}]},
                      {rabbit_channel,handle_cast,2,
                          [{file,"src/rabbit_channel.erl"},{line,457}]}]}
     Offender:   [{pid,<0.1336.0>},
                  {name,channel},
                  {mfargs,
                      {amqp_channel,start_link,
                          [direct,<0.1330.0>,1,<0.1335.0>,
                           {<<"<[email protected]>">>,1}]}},
                  {restart_type,intrinsic},
                  {shutdown,30000},
                  {child_type,worker}]


=SUPERVISOR REPORT==== 26-Jan-2017::08:06:26 ===
     Supervisor: {<0.1337.0>,rabbit_channel_sup}
     Context:    child_terminated
     Reason:     {function_clause,
                     [{httpc,request,
                          [get,
                           {"http://localhost:15672/api/overview",
                            [{"Authorization","Basic Z3Vlc3Q6Z3Vlc3Q="}],
                            "application/json",<<" ">>},
                           [{version,"HTTP/1.0"}],
                           [],default],
                          [{file,"httpc.erl"},{line,149}]},
                      {rabbit_exchange_type_management,handle_rpc,6,
                          [{file,"src/rabbit_exchange_type_management.erl"},
                           {line,85}]},
                      {rabbit_exchange_type_management,'-route/2-lc$^0/1-0-',
                          6,
                          [{file,"src/rabbit_exchange_type_management.erl"},
                           {line,61}]},
                      {rabbit_exchange_type_management,route,2,
                          [{file,"src/rabbit_exchange_type_management.erl"},
                           {line,61}]},
                      {rabbit_exchange,route1,3,
                          [{file,"src/rabbit_exchange.erl"},{line,381}]},
                      {rabbit_exchange,route,2,
                          [{file,"src/rabbit_exchange.erl"},{line,371}]},
                      {rabbit_channel,handle_method,3,
                          [{file,"src/rabbit_channel.erl"},{line,949}]},
                      {rabbit_channel,handle_cast,2,
                          [{file,"src/rabbit_channel.erl"},{line,457}]}]}
     Offender:   [{pid,<0.1339.0>},
                  {name,channel},
                  {mfargs,
                      {rabbit_channel,start_link,
                          [1,<0.1336.0>,<0.1336.0>,<0.1330.0>,
                           <<"<[email protected]>">>,
                           rabbit_framing_amqp_0_9_1,
                           {user,<<"guest">>,
                               [administrator],
                               [{rabbit_auth_backend_internal,none}]},
                           <<"/">>,
                           [{<<"publisher_confirms">>,bool,true},
                            {<<"exchange_exchange_bindings">>,bool,true},
                            {<<"basic.nack">>,bool,true},
                            {<<"consumer_cancel_notify">>,bool,true},
                            {<<"connection.blocked">>,bool,true},
                            {<<"authentication_failure_close">>,bool,true}],
                           <0.1333.0>,<0.1338.0>]}},
                  {restart_type,intrinsic},
                  {shutdown,70000},
                  {child_type,worker}]


=SUPERVISOR REPORT==== 26-Jan-2017::08:06:26 ===
     Supervisor: {<0.1337.0>,rabbit_channel_sup}
     Context:    shutdown
     Reason:     reached_max_restart_intensity
     Offender:   [{pid,<0.1339.0>},
                  {name,channel},
                  {mfargs,
                      {rabbit_channel,start_link,
                          [1,<0.1336.0>,<0.1336.0>,<0.1330.0>,
                           <<"<[email protected]>">>,
                           rabbit_framing_amqp_0_9_1,
                           {user,<<"guest">>,
                               [administrator],
                               [{rabbit_auth_backend_internal,none}]},
                           <<"/">>,
                           [{<<"publisher_confirms">>,bool,true},
                            {<<"exchange_exchange_bindings">>,bool,true},
                            {<<"basic.nack">>,bool,true},
                            {<<"consumer_cancel_notify">>,bool,true},
                            {<<"connection.blocked">>,bool,true},
                            {<<"authentication_failure_close">>,bool,true}],
                           <0.1333.0>,<0.1338.0>]}},
                  {restart_type,intrinsic},
                  {shutdown,70000},
                  {child_type,worker}]


=SUPERVISOR REPORT==== 26-Jan-2017::08:06:26 ===
     Supervisor: {<0.1334.0>,amqp_channel_sup}
     Context:    shutdown
     Reason:     reached_max_restart_intensity
     Offender:   [{pid,<0.1336.0>},
                  {name,channel},
                  {mfargs,
                      {amqp_channel,start_link,
                          [direct,<0.1330.0>,1,<0.1335.0>,
                           {<<"<[email protected]>">>,1}]}},
                  {restart_type,intrinsic},
                  {shutdown,30000},
                  {child_type,worker}]


=WARNING REPORT==== 26-Jan-2017::08:06:26 ===
Connection (<0.1330.0>) closing: internal error in channel (<0.1336.0>): {function_clause,
                                                                          [{httpc,
                                                                            request,
                                                                            [get,
                                                                             {"http://localhost:15672/api/overview",
                                                                              [{"Authorization",
                                                                                "Basic Z3Vlc3Q6Z3Vlc3Q="}],
                                                                              "application/json",
                                                                              <<" ">>},
                                                                             [{version,
                                                                               "HTTP/1.0"}],
                                                                             [],
                                                                             default],
                                                                            [{file,
                                                                              "httpc.erl"},
                                                                             {line,
                                                                              149}]},
                                                                           {rabbit_exchange_type_management,
                                                                            handle_rpc,
                                                                            6,
                                                                            [{file,
                                                                              "src/rabbit_exchange_type_management.erl"},
                                                                             {line,
                                                                              85}]},
                                                                           {rabbit_exchange_type_management,
                                                                            '-route/2-lc$^0/1-0-',
                                                                            6,
                                                                            [{file,
                                                                              "src/rabbit_exchange_type_management.erl"},
                                                                             {line,
                                                                              61}]},
                                                                           {rabbit_exchange_type_management,
                                                                            route,
                                                                            2,
                                                                            [{file,
                                                                              "src/rabbit_exchange_type_management.erl"},
                                                                             {line,
                                                                              61}]},
                                                                           {rabbit_exchange,
                                                                            route1,
                                                                            3,
                                                                            [{file,
                                                                              "src/rabbit_exchange.erl"},
                                                                             {line,
                                                                              381}]},
                                                                           {rabbit_exchange,
                                                                            route,
                                                                            2,
                                                                            [{file,
                                                                              "src/rabbit_exchange.erl"},
                                                                             {line,
                                                                              371}]},
                                                                           {rabbit_channel,
                                                                            handle_method,
                                                                            3,
                                                                            [{file,
                                                                              "src/rabbit_channel.erl"},
                                                                             {line,
                                                                              949}]},
                                                                           {rabbit_channel,
                                                                            handle_cast,
                                                                            2,
                                                                            [{file,
                                                                              "src/rabbit_channel.erl"},
                                                                             {line,
                                                                              457}]}]}

=ERROR REPORT==== 26-Jan-2017::08:06:26 ===
webmachine error: path="/api/exchanges/%2F/management/publish"
{error,
    {error,function_clause,
        [{rabbit_mgmt_wm_exchange_publish,bad,
             [{function_clause,
                  [{httpc,request,
                       [get,
                        {"http://localhost:15672/api/overview",
                         [{"Authorization","Basic Z3Vlc3Q6Z3Vlc3Q="}],
                         "application/json",<<" ">>},
                        [{version,"HTTP/1.0"}],
                        [],default],
                       [{file,"httpc.erl"},{line,149}]},
                   {rabbit_exchange_type_management,handle_rpc,6,
                       [{file,"src/rabbit_exchange_type_management.erl"},
                        {line,85}]},
                   {rabbit_exchange_type_management,'-route/2-lc$^0/1-0-',6,
                       [{file,"src/rabbit_exchange_type_management.erl"},
                        {line,61}]},
                   {rabbit_exchange_type_management,route,2,
                       [{file,"src/rabbit_exchange_type_management.erl"},
                        {line,61}]},
                   {rabbit_exchange,route1,3,
                       [{file,"src/rabbit_exchange.erl"},{line,381}]},
                   {rabbit_exchange,route,2,
                       [{file,"src/rabbit_exchange.erl"},{line,371}]},
                   {rabbit_channel,handle_method,3,
                       [{file,"src/rabbit_channel.erl"},{line,949}]},
                   {rabbit_channel,handle_cast,2,
                       [{file,"src/rabbit_channel.erl"},{line,457}]}]},
              {wm_reqdata,'POST',http,
                  {1,1},
                  "172.17.0.1",
                  {wm_reqstate,#Port<0.20412>,
                      [{'content-encoding',"gzip"},
                       {'content-type',"application/json"},
                       {resource_module,rabbit_mgmt_wm_exchange_publish}],
                      undefined,"172.17.0.1",
                      {wm_reqdata,'POST',http,
                          {1,1},
                          "172.17.0.1",undefined,[],
                          "/api/exchanges/%2F/management/publish",
                          "/api/exchanges/%2F/management/publish",
                          [{exchange,"management"},{vhost,"%2F"}],
                          [],"../../../../..",500,1073741824,67108864,[],[],
                          {12,
                           {"host",
                            {'Host',"localhost:15672"},
                            {"connection",
                             {'Connection',"keep-alive"},
                             {"authorization",
                              {'Authorization',"Basic Z3Vlc3Q6Z3Vlc3Q="},
                              {"accept",
                               {'Accept',"*/*"},
                               nil,
                               {"accept-encoding",
                                {'Accept-Encoding',"gzip, deflate, br"},
                                nil,
                                {"accept-language",
                                 {'Accept-Language',
                                     "en-US,en;q=0.8,ro;q=0.6,ru;q=0.4"},
                                 nil,nil}}},
                              nil},
                             {"content-length",
                              {'Content-Length',"240"},
                              nil,
                              {"content-type",
                               {'Content-Type',"text/plain;charset=UTF-8"},
                               nil,nil}}},
                            {"origin",
                             {"Origin","http://localhost:15672"},
                             nil,
                             {"x-vhost",
                              {"X-Vhost",[]},
                              {"user-agent",
                               {'User-Agent',
                                   "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36"},
                               {"referer",
                                {'Referer',"http://localhost:15672/"},
                                nil,nil},
                               nil},
                              nil}}}},
                          not_fetched_yet,false,
                          {3,
                           {"content-type",
                            {"Content-Type","application/json"},
                            {"content-encoding",
                             {"Content-Encoding","gzip"},
                             nil,nil},
                            {"vary",{"Vary","Accept-Encoding"},nil,nil}}},
                          <<>>,follow_request,[],80,[]},
                      undefined,undefined,
                      {wm_log_data,undefined,
                          {1485,417986,662676},
                          'POST',
                          {12,
                           {"host",
                            {'Host',"localhost:15672"},
                            {"connection",
                             {'Connection',"keep-alive"},
                             {"authorization",
                              {'Authorization',"Basic Z3Vlc3Q6Z3Vlc3Q="},
                              {"accept",
                               {'Accept',"*/*"},
                               nil,
                               {"accept-encoding",
                                {'Accept-Encoding',"gzip, deflate, br"},
                                nil,
                                {"accept-language",
                                 {'Accept-Language',
                                     "en-US,en;q=0.8,ro;q=0.6,ru;q=0.4"},
                                 nil,nil}}},
                              nil},
                             {"content-length",
                              {'Content-Length',"240"},
                              nil,
                              {"content-type",
                               {'Content-Type',"text/plain;charset=UTF-8"},
                               nil,nil}}},
                            {"origin",
                             {"Origin","http://localhost:15672"},
                             nil,
                             {"x-vhost",
                              {"X-Vhost",[]},
                              {"user-agent",
                               {'User-Agent',
                                   "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36"},
                               {"referer",
                                {'Referer',"http://localhost:15672/"},
                                nil,nil},
                               nil},
                              nil}}}},
                          "172.17.0.1",
                          "/api/exchanges/%2F/management/publish",
                          {1,1},
                          404,0,undefined,undefined,undefined}},
                  [],"/api/exchanges/%2F/management/publish",
                  "/api/exchanges/%2F/management/publish",
                  [{exchange,"management"},{vhost,"%2F"}],
                  [],"../../../../..",500,1073741824,67108864,[],[],
                  {12,
                   {"host",
                    {'Host',"localhost:15672"},
                    {"connection",
                     {'Connection',"keep-alive"},
                     {"authorization",
                      {'Authorization',"Basic Z3Vlc3Q6Z3Vlc3Q="},
                      {"accept",
                       {'Accept',"*/*"},
                       nil,
                       {"accept-encoding",
                        {'Accept-Encoding',"gzip, deflate, br"},
                        nil,
                        {"accept-language",
                         {'Accept-Language',
                             "en-US,en;q=0.8,ro;q=0.6,ru;q=0.4"},
                         nil,nil}}},
                      nil},
                     {"content-length",
                      {'Content-Length',"240"},
                      nil,
                      {"content-type",
                       {'Content-Type',"text/plain;charset=UTF-8"},
                       nil,nil}}},
                    {"origin",
                     {"Origin","http://localhost:15672"},
                     nil,
                     {"x-vhost",
                      {"X-Vhost",[]},
                      {"user-agent",
                       {'User-Agent',
                           "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36"},
                       {"referer",
                        {'Referer',"http://localhost:15672/"},
                        nil,nil},
                       nil},
                      nil}}}},
                  not_fetched_yet,false,
                  {3,
                   {"content-type",
                    {"Content-Type","application/json"},
                    {"content-encoding",{"Content-Encoding","gzip"},nil,nil},
                    {"vary",{"Vary","Accept-Encoding"},nil,nil}}},
                  <<>>,follow_request,[],80,[]},
              {context,
                  {user,<<"guest">>,
                      [administrator],
                      [{rabbit_auth_backend_internal,none}]},
                  <<"guest">>,undefined}],
             [{file,"src/rabbit_mgmt_wm_exchange_publish.erl"},{line,97}]},
         {rabbit_mgmt_util,with_channel,5,
             [{file,"src/rabbit_mgmt_util.erl"},{line,604}]},
         {rabbit_mgmt_util,with_decode,5,
             [{file,"src/rabbit_mgmt_util.erl"},{line,486}]},
         {rabbit_mgmt_wm_exchange_publish,process_post,2,
             [{file,"src/rabbit_mgmt_wm_exchange_publish.erl"},{line,54}]},
         {webmachine_resource,resource_call,3,
             [{file,"src/webmachine_resource.erl"},{line,186}]},
         {webmachine_resource,do,3,
             [{file,"src/webmachine_resource.erl"},{line,142}]},
         {webmachine_decision_core,resource_call,1,
             [{file,"src/webmachine_decision_core.erl"},{line,48}]},
         {webmachine_decision_core,decision,1,
             [{file,"src/webmachine_decision_core.erl"},{line,486}]}]}}

Detect modern TLS listeners in the management plugin

As of rabbitmq/rabbitmq-management#618 there is one more way of configuring listeners, in particular for TLS. This plugin hasn't been updated to support them,
so a node that uses e.g. the following configuration

management.ssl.port       = 15671
management.ssl.cacertfile = /path/to/ca_certificate.pem
management.ssl.certfile   = /path/to/server_certificate.pem
management.ssl.keyfile    = /path/to/server_key.pem

would incorrectly assume that it should use HTTP and not HTTPS for URI schema because the application environment key structure would be different from before rabbitmq/rabbitmq-management#618 days.

[168224342]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.