AMQP 0.9.1 Protocol — sgcWebSockets | eSeGeCe

AMQP 0.9.1 Protocol

The widely-deployed AMQP version used by RabbitMQ. Full support for exchanges, queues, bindings, consumer acknowledgments, and transactions.

TsgcWSPClient_AMQP

AMQP 0-9-1 subprotocol client — exchanges, queues, bindings, basic.publish / basic.consume, transactions and confirms over a WebSocket or raw-TCP carrier.

Component class

TsgcWSPClient_AMQP

Protocol

AMQP 0-9-1

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Drop the component, set a few properties, go

Pair a TsgcWebSocketClient with TsgcWSPClient_AMQP, open a channel, declare an exchange / queue, publish and consume.

uses
  sgcWebSocket, sgcWebSocket_Protocols, sgcAMQP_Classes;

var
  WSClient: TsgcWebSocketClient;
  AMQP: TsgcWSPClient_AMQP;
begin
  WSClient := TsgcWebSocketClient.Create(nil);
  WSClient.Specifications.RFC6455 := False;
  WSClient.Host := 'broker.example.com';
  WSClient.Port := 5672;

  AMQP := TsgcWSPClient_AMQP.Create(nil);
  AMQP.Client := WSClient;

  AMQP.OnAMQPConnect      := AMQPConnect;
  AMQP.OnAMQPBasicDeliver := AMQPBasicDeliver;

  WSClient.Active := True;
end;

procedure TForm1.AMQPConnect(Sender: TObject);
begin
  AMQP.OpenChannel('ch1');
  AMQP.DeclareExchange('ch1', 'orders', 'direct');
  AMQP.DeclareQueue('ch1', 'orders_in');
  AMQP.BindQueue('ch1', 'orders_in', 'orders', 'create');
  AMQP.Consume('ch1', 'orders_in');

  // Publish a message
  AMQP.PublishMessage('ch1', 'orders', 'create', '{"id":42}');
end;

What's inside

6 published properties, 41 methods, 25 events — pulled from the component reference.

Connection

Published properties: Client, Broker, Guid.

Reliability

Published properties: HeartBeat.

Authentication

Events: OnAMQPAuthentication, OnAMQPChallenge.

Lifecycle

Events: OnAMQPConnect, OnAMQPDisconnect, OnAMQPException.

Advanced

Methods: WriteData.

Diagnostics

Published properties: Version.

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\091 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 0.9.1?

Download the free trial and connect to RabbitMQ in minutes.