Class Connection11Example1
In: examples/conn11_ex1.rb
Parent: Object

Stomp 1.1 Connection Example 1

Purpose: to demonstrate a connect and disconnect sequence using Stomp 1.1.

Note: this example assumes that you have at least the 1.2.0 gem release installed.

When you:

  • Use a Stomp 1.1 compliant broker
  • Want a Stomp 1.1 level connection and functionality

then your code must specifically request that environment.

You need to supply all of the normal values expected of course:

  • login - the user name
  • passcode - the password
  • host - the host to connect to
  • port - the port to connect to

Additionaly you are required to supply the 1.1 connection data as documented in the Stomp 1.1 specification: stomp.github.com/stomp-specification-1.1.html You are urged to become familiar with the spec. It is a short document.

This includes:

  • The Stomp version(s) you wish the broker to consider
  • The broker vhost to connect to

You may optionally specify other 1.1 data:

  • heartbeat request

Using the stomp gem, you can specify this data in the "connect_headers" Hash parameter or a paramaterized connection request. This example uses a parameterized request.

Methods

new   run  

Public Class methods

Initialize

Public Instance methods

Run example

[Validate]