AMQP 0.9.1 Protocol
The widely-deployed AMQP version used by RabbitMQ. Full support for exchanges, queues, bindings, consumer acknowledgments, and transactions.
The widely-deployed AMQP version used by RabbitMQ. Full support for exchanges, queues, bindings, consumer acknowledgments, and transactions.
AMQP 0-9-1 subprotocol client — exchanges, queues, bindings, basic.publish / basic.consume, transactions and confirms over a WebSocket or raw-TCP carrier.
TsgcWSPClient_AMQP
Windows, macOS, Linux, iOS, Android
Professional / Enterprise
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;
6 published properties, 41 methods, 25 events — pulled from the component reference.
Published properties: Client, Broker, Guid.
Published properties: HeartBeat.
Events: OnAMQPAuthentication, OnAMQPChallenge.
Events: OnAMQPConnect, OnAMQPDisconnect, OnAMQPException.
Methods: WriteData.
Published properties: Version.
Authoritative sources for the protocols this component implements.
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. | Abrir | |
| 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. | Abrir | |
| Manual do usuário (PDF) Manual completo cobrindo todos os componentes da biblioteca. | Abrir |