Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get messages off a RabbitMQ... Queue!
require 'httparty'
require 'json'
class QueueInspector
include HTTParty
basic_auth "guest", "guest"
base_uri ""
def messages
body = {'count' => 5,'requeue' => true, 'encoding' => 'auto', 'truncate' => 50000}.to_json
headers = {"Content-Type" => "application/json"}
options = {body: body, headers: headers} "/api/queues/%2f/my_queue/get", options
response =
puts response.code
puts response.body
curl -i -X POST -u guest:guest -H "Content-Type: application/json" -d '{"count":5,"requeue":true,"encoding":"auto","truncate":50000}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.