Create a shovel with code or RabbitMqctl

792 views
Skip to first unread message

JJ Baird

unread,
Sep 11, 2015, 2:13:50 PM9/11/15
to rabbitmq-users
I am trying to create a shovel without having to use the management interface, so that it can be created automatically when the software runs. I am using c# to create the queues and I am using rabbitmcqctl to create users during the install. I am happy to use either. Is it possible to create a shovel with any of the 2 methods?

Alex Corvin

unread,
Sep 11, 2015, 2:25:44 PM9/11/15
to rabbitmq-users
I use the rabbitmqadmin script (provided through enabling the rabbitmq management plugin, I believe) to create mine programmatically, is that an option for you?

JJ Baird

unread,
Sep 11, 2015, 2:28:31 PM9/11/15
to rabbitmq-users
I enable the plugin as a default when the app installs. So that would indeed be an option, could you share a sample of that script?

Michael Klishin

unread,
Sep 11, 2015, 2:30:16 PM9/11/15
to rabbitm...@googlegroups.com, JJ Baird
You can create dynamic Shovels via HTTP API. See management API doc page.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Alex Corvin

unread,
Sep 11, 2015, 2:36:22 PM9/11/15
to rabbitmq-users
I believe that rabbitmqadmin is just a nice interface into the management api that michael just referenced. I obtain it from http://localhost:15672/cli/rabbitmqadmin

I believe a command like this would work:

rabbitmqadmin -V VHOST declare parameter component=shovel name=SHOVEL_NAME value='{
            "ack-mode": "on-publish",
            "add-forward-headers": false,
            "delete-after": "never",
            "dest-uri": [
              "DESTINATION_AMQP_URL"
            ],
            "src-queue": "SOURCE_QUEUE",
            "src-uri": [
              "SOURCE_AMQP_URL"
            ]
          }'


I create mine by saving that as a json file first then using the rabbitmqadmin import subcommand
Reply all
Reply to author
Forward
0 new messages