2

I created shovels using , rabbitmqctl set_parameter shovel "MyShovel" ......

Now i want to delete it, Can you please tell me on how to achieve it using commandline.

vinod hy
  • 827
  • 2
  • 14
  • 26
  • I am using it in windows. i tried using , rabbitmqctl eval 'rabbit_shovel_status:remove({"MyShovel"}).' I get error as below, Error: syntax error before: – vinod hy Apr 20 '17 at 05:08
  • This command, rabbitmqctl eval "rabbit_shovel_status:remove({'/','TestShovel'})." returns Ok. But i still dont see shovel getting deleted. FYI,TestShovel status is in terminated state. – vinod hy Apr 20 '17 at 05:59
  • Can anyone please help me – vinod hy Apr 21 '17 at 15:25
  • rabbitmqctl clear_parameter shovel MyShovel. This command works for delete shovel through command line – vinod hy Apr 21 '17 at 15:38
  • rabbitmqctl takes longer time to process creation and deletion of shovel. Can we achieve it using rabbitmqadmin – vinod hy Apr 24 '17 at 15:32
  • rabbitmqadmin usage to delete a single shovel as below, rabbitmqadmin.py delete parameter component=shovel name=MyShovel .. It responds very quickly within a second rabbitmqctl usage: rabbitmqctl clear_parameter shovel myshovel takes little more time.Close to 6 seconds. I feel rabbitmqadmin is faster in response. Is it expected behaviour. – vinod hy Apr 24 '17 at 16:35
  • Now,I am trying to find a way to create shovels using rabbitmqadmin. The below command i am using, rabbitmqadmin.py -V localhost declare parameter component=shovel name=MyShovel value="{""ack-mode"": ""on-publish"",""add-forward-headers"": false,""delete-after"": ""never"",""dest-uri"": [""127.0.0.1""],""dest-exchange"":""TestExchange"",""src-queue"": ""myqueue"",""src-uri"": [""127.0.0.1""]}" I get error as follows, *** Not found: /api/parameters/shovel/localhost/MyShovel Any idea? Please tell me what mistake i am doing here in command. I am performing this on windows. – vinod hy Apr 24 '17 at 16:36
  • rabbitmqadmin.py declare parameter component=shovel name=MyShovel value="{""ack-mode"": ""on-publish"",""add-forward-headers"": false,""delete-after"": ""never"",""dest-uri"": [""amqp://tester:tester@localhost""],""dest-exchange"":""ControlExchange"",""src-queue"": ""myqueue"",""src-uri"": [""amqp://tester:tester@localhost""]}" I removed the -V localhost parameter.I also changed the source and dest uri declaration to proper uris. and it works. Hope this helps to other members here – vinod hy Apr 24 '17 at 17:55

2 Answers2

1

I tried this and it works more or less instantly:

rabbitmqctl clear_parameter shovel MyShovel
Dave Yarwood
  • 2,866
  • 1
  • 17
  • 29
  • You wouldn't happen to know how to delete a shovel that contains spaces in the name? I tried `rabbitmqctl clear_parameter shovel 'Move from the-dead-letter'` but that syntax appears incorrect. I have 3 of these zombie shovels. – Lee Grissom Jun 03 '20 at 23:34
  • @LeeGrissom I haven't tried doing that specifically, but I do remember running into an issue where I had to URL-encode the password to a Rabbit queue when setting up a shovel (if the password contains certain characters). So, maybe try URL-encoding the shovel name? => `Move%20from%20the-dead-letter` – Dave Yarwood Jun 03 '20 at 23:46
  • I tried that just now and same result. I also tried surrounding the parameter with double-quotes " ", but I get the same error message: `Error: Parameter does not exist.` I'm starting to think the syntax might not be the problem in my situation. I might have a bigger problem going on. :( – Lee Grissom Jun 04 '20 at 00:10
0

You can also list and delete shovels from the command line using rabbitmqadmin

Listing Shovels command

rabbitmqadmin --host=HOST --port=443 --ssl --vhost=/ --username=USERNAME --password=PASSWORD -f tsv -q list parameters name component

Delete a Shovel command

rabbitmqadmin --host=HOST --port=443 --ssl --vhost=/ --username=USERNAME --password=PASSWORD -f tsv -q delete parameter component=shovel name=nameOfShovel
biniam
  • 8,099
  • 9
  • 49
  • 58