module Stomp11Common
Public Instance Methods
get_connection()
click to toggle source
Create a 1.1 commection
# File examples/stomp11_common.rb, line 30 def get_connection() conn_hdrs = {"accept-version" => "1.1", # 1.1 only "host" => virt_host, # the vhost } conn_hash = { :hosts => [ {:login => login, :passcode => passcode, :host => host, :port => port}, ], :connect_headers => conn_hdrs, } conn = Stomp::Connection.new(conn_hash) end
host()
click to toggle source
Server host
# File examples/stomp11_common.rb, line 18 def host() ENV['STOMP_HOST'] || "localhost" # The connect host name end
login()
click to toggle source
User id
# File examples/stomp11_common.rb, line 10 def login() ENV['STOMP_USER'] || 'guest' end
nmsgs()
click to toggle source
Number of messages
# File examples/stomp11_common.rb, line 43 def nmsgs() (ENV['STOMP_NMSGS'] || 1).to_i # Number of messages end
passcode()
click to toggle source
Password
# File examples/stomp11_common.rb, line 14 def passcode() ENV['STOMP_PASSCODE'] || 'guest' end
port()
click to toggle source
Server port
# File examples/stomp11_common.rb, line 22 def port() (ENV['STOMP_PORT'] || 62613).to_i # !! The author runs Apollo listening here end
virt_host()
click to toggle source
Required vhost name
# File examples/stomp11_common.rb, line 26 def virt_host() ENV['STOMP_VHOST'] || "localhost" # The 1.1 virtual host name end