Class | Stomp::Connection |
In: |
lib/stomp/connection.rb
|
Parent: | Object |
Low level connection which maps commands and supports synchronous receives
connection_frame | [R] | |
disconnect_receipt | [R] | |
hb_received | [R] | |
hb_sent | [R] | |
protocol | [R] | |
session | [R] |
A new Connection object accepts the following parameters:
login (String, default : '') passcode (String, default : '') host (String, default : 'localhost') port (Integer, default : 61613) reliable (Boolean, default : false) reconnect_delay (Integer, default : 5) e.g. c = Connection.new("username", "password", "localhost", 61613, true)
Hash:
hash = { :hosts => [ {:login => "login1", :passcode => "passcode1", :host => "localhost", :port => 61616, :ssl => false}, {:login => "login2", :passcode => "passcode2", :host => "remotehost", :port => 61617, :ssl => false} ], :reliable => true, :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, :connect_timeout => 0, :connect_headers => {}, :parse_timeout => 5, :logger => nil, } e.g. c = Connection.new(hash)
TODO Stomp URL :
A Stomp URL must begin with 'stomp://' and can be in one of the following forms: stomp://host:port stomp://host.domain.tld:port stomp://user:pass@host:port stomp://user:pass@host.domain.tld:port
Syntactic sugar for ‘Connection.new’ See ‘initialize’ for usage.
Acknowledge a message, used when a subscription has specified client acknowledgement ( connection.subscribe "/queue/a", :ack => ‘client‘g
Accepts a transaction header ( :transaction => ‘some_transaction_id’ )
Publish message to destination
To disable content length header ( :suppress_content_length => true ) Accepts a transaction header ( :transaction => ‘some_transaction_id’ )
Send a message back to the source or to the dead letter queue
Accepts a dead letter queue option ( :dead_letter_queue => "/queue/DLQ" ) Accepts a limit number of redeliveries option ( :max_redeliveries => 6 ) Accepts a force client acknowledgement option (:force_client_ack => true)