romp

Romp is a lightweight Streaming Text Oriented Messaging Protocol client for Ruby. Stomp is a text-based wire format that lets clients communicate through a variety Stomp message brokers, providing interoperable, cross-language messaging.

Getting started

Install a stomp broker and start it up. Both StompServer and CoilMQ don’t seem to handle ‘ack:auto` correctly, so I’ve been testing with HornetQ.

git clone git://github.com/jmesnil/hornetq-stomp.git
cd hornetq-stomp
ant server

Usage

require 'romp'

r1 = Romp.new("localhost", 61613)
r2 = Romp.new("localhost", 61613)

r1.with_connection(:login => "foo", :password => "password") do
  r1.send("foo", :destination => "/queue/a")
  r1.send("bar", :destination => "/queue/a")
end

r2.with_connection(:login => "bar", :password => "secret") do
  r2.subscribe(:destination => "/queue/a")
  puts r2.receive.body # => foo
  puts r2.receive.body # => bar
end

Copyright © 2010 Justin Balthrop. See LICENSE for details.