AMQP 1.0 Protocol — sgcWebSockets | eSeGeCe

AMQP 1.0 Protocol

The OASIS standard for advanced messaging. Connect to Azure Service Bus, Apache Qpid, and any AMQP 1.0 compliant broker from Delphi.

TsgcWSPClient_AMQP1

AMQP 1.0 subprotocol client — sessions, sender and receiver links, Claims-Based-Security tokens for Azure Service Bus, over a WebSocket or raw-TCP carrier.

Component class

TsgcWSPClient_AMQP1

Protocol

AMQP 1.0

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Guide

Delphi AMQP Client: AMQP 1.0 and 0.9.1 side by side, with code samples.

Drop the component, set a few properties, go

CreateSession, then CreateSenderLink / CreateReceiverLink, then send and receive. CBS helpers wrap Azure Service Bus SAS / OAuth.

uses
  sgcWebSocket, sgcWebSocket_Protocols, sgcAMQP1_Session, sgcAMQP1_Classes;

var
  WSClient: TsgcWebSocketClient;
  AMQP1: TsgcWSPClient_AMQP1;
  oSession: TsgcAMQP1Session;
  oSender:  TsgcAMQP1SenderLink;
begin
  WSClient := TsgcWebSocketClient.Create(nil);
  WSClient.Specifications.RFC6455 := False;
  WSClient.Host := 'broker.example.com';
  WSClient.Port := 5672;

  AMQP1 := TsgcWSPClient_AMQP1.Create(nil);
  AMQP1.Client := WSClient;

  AMQP1.OnAMQPConnect      := AMQPConnect;
  AMQP1.OnAMQPMessage      := AMQPMessage;
  AMQP1.OnAMQPSessionOpen  := AMQPSessionOpen;
  AMQP1.OnAMQPLinkOpen     := AMQPLinkOpen;

  WSClient.Active := True;

  oSession := AMQP1.CreateSession('session-1');
  // Links are addressed by session name, link name and target/source address
  oSender  := AMQP1.CreateSenderLink(oSession.ID,
    'sender-orders', '/queue/orders');
  // Receivers handle pushed deliveries through OnAMQPMessage
  AMQP1.CreateReceiverLink(oSession.ID,
    'receiver-orders', '/queue/orders');
end;

What's inside

5 published properties, 12 methods, 14 events — pulled from the component reference.

Connection

Published properties: Client, Broker, Guid.

Messaging

Events: OnAMQPMessage, OnAMQPMessageSent, OnAMQPMessageSentAck.

Authentication

Events: OnAMQPSASLAuthentication.

Sessions

Methods: CreateSession, CloseSession.

Lifecycle

Events: OnAMQPConnect, OnAMQPDisconnect, OnAMQPClose.

Advanced

Methods: WriteData.

Specifications & references

Authoritative sources for the protocols this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Demo Project — Demos\Protocols\AMQP\100 Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.
Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Ready to Get Started with AMQP 1.0?

Download the free trial and connect to Azure Service Bus or any AMQP 1.0 broker.