Skip to content

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue. Includes: failover logic, ssl support.

License

Notifications You must be signed in to change notification settings

electronicbites/stomp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1c98fbb · Aug 10, 2011
May 9, 2008
Aug 10, 2011
Jun 14, 2011
May 7, 2011
May 7, 2011
Jan 9, 2011
Jun 15, 2011
Jan 30, 2006
Aug 10, 2011
Jun 15, 2011
Jun 15, 2011

Repository files navigation

README

Overview

An implementation of the Stomp protocol for Ruby. See:

Example Usage

require 'stomp'
client = Stomp::Client.new("guest", "guest", "localhost", 61613)
client.publish("/queue/myfirst", "hello world!")
client.subscribe("/queue/myfirst") 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.send("/my/queue", "hello world!")
client.subscribe("/my/queue") 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)

Contact info

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

The project is now maintained by Johan Sørensen <[email protected]> and others.

Source Code

https://github.com/morellon/stomp/
http://gitorious.org/projects/stomp/
http://github.com/js/stomp/

Project urls

Project Home :

http://gitorious.org/projects/stomp/
http://rubyforge.org/projects/stomp/

Stomp Protocol Info :

http://stomp.github.com/index.html
http://stomp.codehaus.org/Protocol

Contributors

The following people have contributed to Stomp:

About

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue. Includes: failover logic, ssl support.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%