Protocol
STOMP
Simple Text Oriented Messaging Protocol
STOMP provides an interoperable wire format so that STOMP clients can communicate with any STOMP message broker to provide easy and widespread messaging interoperability among many languages, platforms and brokers.

STOMP is simple

Simple (or Streaming) Text Oriented Message Protocol (STOMP), is a simple text-based protocol

Message-oriented Middleware

Designed for working with message-oriented middleware (MOM)

Interoperable wire format

It provides an interoperable wire format that allows STOMP clients to talk with any message broker supporting the protocol.

STOMP is language-agnostic

Any broker developed for one programming language or platform can receive communications from client software developed in another language.

  • STOMP Client Help
  • STOMP Demo
  • Components Trial

Create Connection

// Create websocket client and set server options
oClient := TsgcWebSocketClient.Create(nil);
oClient.Host := 'www.esegece.com';
oClient.Port := 15674;
oClient.Options.Parameters := '/ws';

// Create STOMP protocol and assign to websocket client
oSTOMP := TsgcWSPClient_STOMP.Create(nil);
oSTOMP.Client := oClient;

// STOMP Authentication
oSTOMP.Authentication.Enabled := True;
oSTOMP.Authentication.Username := 'sgc';
oSTOMP.Authentication.Password := 'sgc';

// Handle STOMP methods
oSTOMP.OnSTOMPConnect := OnSTOMPConnectHandler;
oSTOMP.OnSTOMPMessage := OnSTOMPMessageHandler;

// connect to server
oClient.Active := True;

Subscribe

// Subscribe to channel "myTopic"
oSTOMP.Subscribe('id0', 'myTopic');

Publish

// Send a message to all subscribers of channel "myTopic"
oSTOMP.Send('myTopic', 'Text message');

Disconnect

// Disconnect from server
oSTOMP.Disconnect;

Supported Platforms

The component supports the following Platforms:

Delphi   CBuilder Lazarus