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.

Klasa komponentu

TsgcWSPClient_AMQP

Protokół

AMQP 0-9-1

Platformy

Windows, macOS, Linux, iOS, Android

Edycja

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_Protocol_AMQP_Client, sgcAMQP_Classes;

var
  WSClient: TsgcWebSocketClient;
  AMQP: TsgcWSPClient_AMQP;
begin
  WSClient := TsgcWebSocketClient.Create(nil);
  WSClient.Host := 'broker.example.com';
  WSClient.Port := 15674;
  WSClient.Options.Parameters := '/ws';

  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;

Co jest w środku

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.

Diagnostyka

Published properties: Version.

Specyfikacje i odniesienia

Authoritative sources for the protocols this component implements.

Dokumentacja i dema

Przejdź bezpośrednio do dokumentacji komponentu, pobierz gotowy do uruchomienia projekt demonstracyjny i pobierz wersję próbną.

Projekt demonstracyjny — Demos\Protocols\AMQP\091 Gotowy do uruchomienia projekt przykładowy. Dostarczany w pakiecie sgcWebSockets — pobierz wersję próbną poniżej.
Dokument techniczny (PDF) Funkcje, szybki start, przykłady kodu dla Delphi i C++ Builder oraz odniesienia do źródeł — tylko ten komponent.
Podręcznik użytkownika (PDF) Kompleksowy podręcznik obejmujący każdy komponent biblioteki.

Ready to Get Started with AMQP 0.9.1?

Download the free trial and connect to RabbitMQ in minutes.