A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue. Includes: failover logic, ssl support.
Ruby
Pull request Compare This branch is 1 commit ahead, 324 commits behind stompgem:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
examples
lib
spec
test
.gitignore
CHANGELOG.rdoc
LICENSE
README.rdoc
Rakefile
stomp.gemspec

README.rdoc

README

Overview

An implementation of the Stomp protocol for Ruby. See:

New

  • Gem version 1.2.2. Performance and more SSL enhancements.

  • Full support of SSL certificates is announced as of gem version 1.2.1.

  • Support of Stomp protocol level 1.1 is announced as of gem version 1.2.0.

See the change log for details.

Example Usage

client = Stomp::Client.new("test", "user", "localhost", 61613)
client.send("/queue/mine", "hello world!")
client.subscribe("/queue/mine") do |msg|
  p msg
end

Failover + SSL Example URL Usage

options = "initialReconnectDelay=5000&randomize=false&useExponentialBackOff=false"

# remotehost1 uses SSL, remotehost2 doesn't
client = Stomp::Client.new("failover:(stomp+ssl://login1:passcode1@remotehost1:61612,stomp://login2:passcode2@remotehost2:61613)?#{options}")

client.publish("/queue/mine", "hello world!")
client.subscribe("/queue/mine") do |msg|
  p msg
end

Hash Login Example Usage

hash = {
    :hosts => [
      {:login => "login1", :passcode => "passcode1", :host => "remotehost1", :port => 61612, :ssl => true},
      {:login => "login2", :passcode => "passcode2", :host => "remotehost2", :port => 61613, :ssl => false},

    ],
    # These are the default parameters, don't need to be set
    :initial_reconnect_delay => 0.01,
    :max_reconnect_delay => 30.0,
    :use_exponential_back_off => true,
    :back_off_multiplier => 2,
    :max_reconnect_attempts => 0,
    :randomize => false,
    :backup => false,
    :timeout => -1,
    :connect_headers => {},
    :parse_timeout => 5,
    :logger => nil,
  }

  # for client
  client = Stomp::Client.new(hash)

  # for connection
  connection = Stomp::Connection.new(hash)

Hstorical Information

Up until March 2009 the project was maintained and primarily developed by Brian McCallister.

Source Code and Project URLs

https://github.com/stompgem/stomp/

Stomp Protocol Information :

http://stomp.github.com/index.html

Contributors

The following people have contributed to Stomp:

  • Brian McCaliister

  • Glenn Rempe <glenn@rempe.us>

  • jstrachan

  • Marius Mathiesen <marius.mathiesen@gmail.com>

  • Johan S√∏rensen <johan@johansorensen.com>

  • Thiago Morello <stompgem@gmail.com>

  • Guy M. Allard

  • kookster

  • Tony Garnock-Jones <tonyg@lshift.net>

  • chirino

  • Stefan Saasen

  • Neil Wilson

  • Dinesh Majrekar

  • Kiall Mac Innes

  • Rob Skaggs

  • Tom May

  • Lucas Hills

  • Chris Needham

  • R.I. Pienaar

  • tworker

  • James Pearson

Announcements

In the next version of the gem, the dates in CHANGELOG.rdoc will be changed from:

  • yyyy-dd-mm

to:

  • ISO8601 format (yyyymmdd)