Skip to content

Instantly share code, notes, and snippets.

@ismith
Created August 16, 2013 05:10
Show Gist options
  • Save ismith/6247478 to your computer and use it in GitHub Desktop.
Save ismith/6247478 to your computer and use it in GitHub Desktop.
require 'stomp'
max_re = ARGV[0].to_i unless ARGV.empty?
max_re ||= 0
conf = {:hosts => [:host => 'localhost', :ssl => false]}
queue = '/queue/some_queue'
client = Stomp::Client.new(conf)
client.subscribe(queue) do |msg|
puts msg
puts '------------------'
puts
client.unreceive(msg, :max_redeliveries => max_re)
end
client.publish(queue, 'message body!')
sleep 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment