Search code examples
rabbitmqmulemule-studiomulesoftmule-component

clear messages from rabbitMQ queue in mule 3


My requirement is to clear all the messages from queue before processing the flow or publishing anything in the queue. We are using rabbitMQ and due to some reason messages are stucked in the queue and because of that we are facing some issue when we are counting the queue based on the messages. so for the next time before processing we have to clear the queue. Here we have multiple queue like slave1, slave2,slave3 and when api will be triggered in the process section we have to clear the queue.

Kindly suggest how we can do this in mule3. enter image description here


Solution

  • Mule 3 has a generic AMQP connector. It does not support administrative commands from a specific implementation like RabbitMQ, so you can't use the connector.

    You could use RabbitMQ REST API and call it using the HTTP Request connector. See this previous answer to see how to delete queues with Curl, then implement the same request with HTTP Request: https://stackoverflow.com/a/29148299/721855