Native STOMP client libraries for Delphi / Object Pascal: connect your application with enterprise message brokers

Release 2022.12 is now available

Habari STOMP Client libraries enable Object Pascal applications to take advantage of message broker / message queue technology - which is distributed, loosely coupled, reliable and asynchronous - to build integrated systems, using peer-to-peer and publish-subscribe communication models.

The libraries are available for the open source message brokers ActiveMQ, ActiveMQ Artemis, Eclipse OpenMQ and RabbitMQ. ActiveMQ, ActiveMQ Artemis and OpenMQ are also serving as default messaging subsystems in Enterprise Application Servers such as GlassFish, Payara, TomEE+ or WildFly.

Typical use cases of message brokers include: load balancing (distributed processing), client notification in multi-tiered applications, dynamically configuring and controlling software, alerting and logging, and integration with ISAPI, PHP, .NET, Python or Jakarta EE based web applications.

language

Libraries are specialized for different message brokers, but share a single high-level API

view_comfy

Use the feature matrix below to compare the broker-specific capabilities and extra features

get_app

For more information, please choose your version from the top menu or in the matrix header

Code Examples

"Hello, World!" - send to a local broker

code

Connects to a local broker instance with default port and credentials, and sends a text message. This example uses the new, simplified API.

function CreateLocalMQContext: IMQContext;
var
  Factory: IConnectionFactory
begin
  Factory := TBTConnectionFactory.Create;
  Result := Factory.CreateContext;
end;

procedure SendHelloWorld;
var
  Ctx: IMQContext;
  Destination: IDestination;
  Producer: IMQProducer;
begin
  Ctx := CreateLocalMQContext;
  try
    Destination := Ctx.CreateQueue('hello_world');
    Producer := Ctx.CreateProducer;
    Producer.Send(Destination, 'Hello, World!');
  finally
    Ctx.Close;
  end;
end;

"Hello, World!" - receive from a remote broker

code

Connects to a remote broker instance with specified credentials, and receives a text message. This example uses the new, simplified API.

function CreateRemoteMQContext: IMQContext;
var
  Factory: IConnectionFactory
begin
  Factory := TBTConnectionFactory.Create('alice');
  Result := Factory.CreateContext('username', 'password');
end;

procedure ReceiveHelloWorld;
var
  Ctx: IMQContext;
  Destination: IDestination;
  Consumer: IMQConsumer;
  TextMessage: ITextMessage;
begin
  Ctx := CreateRemoteMQContext;
  try
    Destination := Ctx.CreateQueue('hello_world');
    Consumer := Ctx.CreateConsumer(Destination);
    TextMessage := Consumer.Receive(2500) as ITextMessage;
    if Assigned(TextMessage) then ShowMessage(TextMessage.Text);
  finally
    Ctx.Close;
  end;
end;
Version Habari Client for ActiveMQ Habari Client for Artemis Habari Client for OpenMQ Habari Client for RabbitMQ
STOMP version support
Version 1.0 / 1.2 ✓/✓ ✓/✓ ✓/✓ ✓/✓
STOMP optional features
Ack modes auto, client, client-individual
Receipt Requests
Heart-beating #361
Transacted Send
Transacted Ack
Broker-provided STOMP extensions
Message Expiration
Message Priority
Persistent Messages
Rich Message Conversion
Topic Destinations
Queue Destinations
Durable Topics
Temporary Queues ARTEMIS-3164 #1534 (closed)
Message Selector
Queue Browser
Client-side extensions
Failover Protocol
Connection Builder
Testing
DUnit Tests
FPCUnit Tests
Unit test source code
Documentation
API (HTML)
Getting started (PDF)
Example code
Compiler
Delphi 2009+
Free Pascal 3.2.0+
TCP/IP Libraries
Internet Direct (Indy) 10.6.2
Ararat Synapse
Extensible network layer
Logging
SLF4P logging facade
Raw data (Indy Intercept)
Additional Information
Source included
Tested with ActiveMQ 5.16.5 and 5.17.2 ActiveMQ Artemis 2.26.0 and 2.27.0 Eclipse OpenMQ 6.3.0 and 6.4.0-SNAPSHOT RabbitMQ 3.10.11 and 3.11.3
Release date 3 December 2022 3 December 2022 3 December 2022 3 December 2022
Buy now » Buy now » Buy now » Buy now »

① - Not supported by message broker STOMP implementation

② - Limited support, complimentary and/or experimental feature

Use cases

apps

Typical use cases of message brokers include: load balancing (distributed processing), client notification in multi-tiered applications, dynamically configuring and controlling software, alerting and logging, and integration with ISAPI, PHP, .NET, Python or Jakarta EE based web applications.

General

check

Yes! Basic support is included for one year. Advanced and experimental features such as (for example) SSL/TLS, third party libraries, Linux, non-Unicode Delphi versions and message broker configuration are not covered by the basic support plan.

On the library home page you will find a link to the download area for registered users. The credentials (user name and password) will be sent to you when a new release is available.

A trial version with precompiled units (DCU) is not available. To see if the library works, you may use the free demo applications which are included in the demo download file. Also, you may contact Habarisoft to receive additional source code examples.

Licensing

check

Yes, each developer that uses our products must have their own license.

check

No, the licenses are perpetual. However, you will be using the last product version released before your free upgrade period expired.

Distribution Questions

block

No, the source code is not redistributable, even if you change it.

Technical

Internet Direct (Indy) or the Synapse TCP/IP network library is required.

Indy is hosted on GitHub at https://github.com/IndySockets

No, just add the Indy directories Lib\Core, Lib\Protocols and Lib\System to the project search path. The Indy version which is included in Delphi may remain unchanged.

The library includes two experimental adapter classes for usage with OpenSSL, one for Indy (Internet Direct) and one for Synapse. Technical support for these adapter classes and OpenSSL configuration is not included in the basic support package.

No, using a connection concurrently by different threads is unsafe. If different threads need to communicate with the message broker, every thread must use its own IConnection object.

check

Yes! When it is used correctly and as designed, no memory leaks will appear.

check

Yes! Service applications can use the library to communicate with the message broker, if connections are not used concurrently by different threads.

check

Yes! ISAPI DLL modules can use the library to communicate with the message broker, if connections are not used concurrently by different threads.

check

Yes! All library versions include support for transactional sending of messages. Transactional message ack currently is provided for ActiveMQ and RabbitMQ.

check

Yes, the core library works with Free Pascal 3.2.0

No, the library only supports the Stomp wire format.

Advanced Chemistry Development

aim Systems, Inc.

Airport Business Information Systems - Hamburg Airport

Altron HealthTech

Bangkok Medical Software

Baxter Healthcare

BD Kiestra

C.A. Shea & Company

Command Alkon

CompuGroup Medical Malaysia

DrillScan

Emsisoft

Fen Technology

Intelligence Data Communication

Kokusai Inc.

Light & Wonder

logiCells

MESAS

ModivCare

peptides&elephants

Pfizer Manufacturing Belgium

Prime Vision

Polaris Elements

Retail Pro International

STEMCELL Technologies

TSMC

Thum+Mahr

VECTRONIC Aerospace