# move messages from error queue to parent queue in Redhat Active MQ

**URL:** <https://forum.ansible.com/t/move-messages-from-error-queue-to-parent-queue-in-redhat-active-mq/28368>\
**Category:** Ansible Project\
**Created:** [August 20, 2018, 4:34pm UTC](https://forum.ansible.com/t/move-messages-from-error-queue-to-parent-queue-in-redhat-active-mq/28368 "2018-08-20T16:34:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep\_Drall](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@Pradeep\_Drall](https://forum.ansible.com/u/Pradeep_Drall)\
**Post date:** [August 20, 2018, 4:34pm UTC](https://forum.ansible.com/t/move-messages-from-error-queue-to-parent-queue-in-redhat-active-mq/28368/1 "2018-08-20T16:34:20Z")

</div>

Hi,

I would like to move messages from error queue to parent queue in Redhat Active MQ.

I want to automate Jolokia REST Url moveMessages(int,java.lang.String,java.lang.String,boolean) concept through ansible uri module but getting below mentioned error. I use POST and PUT method but getting error.

Please do let me know how to execute this url through ansible script.

// uri.yml

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [August 20, 2018, 8:35pm UTC](https://forum.ansible.com/t/move-messages-from-error-queue-to-parent-queue-in-redhat-active-mq/28368/2 "2018-08-20T20:35:29Z")

</div>

It says " Invalid JSON request".  
Which seems to make sense, as you have set the HTTP method to POST,  
but at the same time you have manually constructed the entire (GET)  
request, and also didn't configure any 'body' parameter.  
I'd start with supplying a properly formatted 'body' parameter first.  
Although I'm not sure what that looks like in your case, because the  
request URL seems to be using a comma (as opposed to an ampersand) to  
separate the query parameters? This may well be my inexperience with  
activemq however.

You might want to read up on the uri module docs, more specifically  
[https://docs.ansible.com/ansible/latest/modules/uri\_module.html#examples](https://docs.ansible.com/ansible/latest/modules/uri_module.html#examples).  
You'll see that several of the option you use (such as HEADER\_\*) are  
deprecated by now.

Dick
