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.
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. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |