Class Stomp::Client
In: lib/stomp/client.rb
Parent: Object

Typical Stomp client class. Uses a listener thread to receive frames from the server, any thread can send.

Receives all happen in one thread, so consider not doing much processing in that thread if you have much message volume.

Methods

abort   acknowledge   begin   close   closed?   commit   connection_frame   disconnect_receipt   join   nack   new   obj_send   open   open?   protocol   publish   running   set_logger   sha1   subscribe   unreceive   unsubscribe   uuid   valid_utf8?  

Attributes

host  [R] 
login  [R] 
parameters  [R] 
passcode  [R] 
port  [R] 
reliable  [R] 

Public Class methods

A new Client object can be initialized using two forms:

Standard positional parameters:

  login     (String,  default : '')
  passcode  (String,  default : '')
  host      (String,  default : 'localhost')
  port      (Integer, default : 61613)
  reliable  (Boolean, default : false)

  e.g. c = Client.new('login', 'passcode', 'localhost', 61613, true)

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://login:passcode@host:port
  stomp://login:passcode@host.domain.tld:port

Public Instance methods

Abort a transaction by name

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’ )

Begin a transaction by name

Close out resources in use by this client

Is this client closed?

Commit a transaction by name

Join the listener thread for this client, generally used to wait for a quit signal

Is this client open?

Convenience method

Publishes message to destination

If a block is given a receipt will be requested and passed to the block on receipt

Accepts a transaction header ( :transaction => ‘some_transaction_id’ )

Check if the thread was created and isn‘t dead

Convenience method

Convenience method for clients

Subscribe to a destination, must be passed a block which will be used as a callback listener

Accepts a transaction header ( :transaction => ‘some_transaction_id’ )

Unreceive a message, sending it back to its queue or to the DLQ

Unsubecribe from a channel

Convenience method for clients

Convenience method

[Validate]