Search code examples
rabbitmqrabbitmqctlrabbitmq-shovel

How can I get the status of a rabbitmq-shovel by the http api


Using "rabbitmqctl eval 'rabbit_shovel_status:status().'" I can get the shovels status in my rabbitmq server.

I activated the modules 'rabbitmq_shovel' and 'rabbitmq_shovel_management'.

I created some dynamic shovels with the HTTP API, the problem I have is that, I want to be able to GET the status of the shovels using the HTTP API, but I can't find a way to do that.

Is there any way to do this using the HTTP API? Or should I use 'rabbitmqctl eval ...'?

I don't want to use the rabbitmqctl, as I want to expose this data in my own API, so my application should be able to access it, without having to make an 'exec'.


Solution

  • Yes you can using:

    http://localhost:15672/api/shovels
    

    you have to install: rabbitmq_shovel_management

    The result is a json like:

    [  
       {  
          "node":"rabbit@gabrieleMacBook",
          "timestamp":"2015-06-02 15:34:27",
          "name":"test",
          "vhost":"/",
          "type":"dynamic",
          "state":"running",
          "definition":{  
             "src-queue":"test",
             "dest-queue":"test2"
          },
          "src_uri":"amqp://xxxxxxx",
          "dest_uri":"amqp://xxxxxxx"
       }
    ]