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.

Classe do componente

TsgcWSPClient_AMQP

Protocolo

AMQP 0-9-1

Plataformas

Windows, macOS, Linux, iOS, Android

Edição

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;

O que tem por dentro

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.

Especificações & referências

Authoritative sources for the protocols this component implements.

Documentação & Demos

Acesse a referência do componente, pegue o projeto demo pronto para executar e baixe a versão de avaliação.

Projeto demo — Demos\Protocols\AMQP\091 Exemplo pronto para executar. Acompanha o pacote sgcWebSockets — baixe a versão de avaliação abaixo.
Documento técnico (PDF) Recursos, início rápido, exemplos de código para Delphi & C++ Builder e referências de fontes primárias — somente deste componente.
Manual do usuário (PDF) Manual completo cobrindo todos os componentes da biblioteca.

Ready to Get Started with AMQP 0.9.1?

Download the free trial and connect to RabbitMQ in minutes.