AMQP 0.9.1 Protocol

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

AMQP 0.9.1

The de facto standard for RabbitMQ integration, used in thousands of production deployments worldwide.

RabbitMQ’s Native Protocol

AMQP 0.9.1 is the protocol version natively supported by RabbitMQ. It defines a rich messaging model based on exchanges, queues, and bindings that enables sophisticated routing patterns. sgcWebSockets provides a complete AMQP 0.9.1 client implementation that connects directly to RabbitMQ on port 5672, supporting channel multiplexing, publisher confirms, consumer acknowledgments, and transactional messaging.

  • Direct, topic, fanout, and headers exchange types
  • Durable and transient queues
  • Consumer acknowledgments and publisher confirms
  • Channel multiplexing over a single TCP connection
PRODUCER EXCH Q1 Q2 CONSUMER

Delphi AMQP 0.9.1 Example

Connect to RabbitMQ, declare a queue, and consume messages.

uses
  sgcAMQP_Client, sgcAMQP_Classes;

var
  AMQPClient: TsgcAMQPClient;

procedure TForm1.FormCreate(Sender: TObject);
begin
  AMQPClient := TsgcAMQPClient.Create(nil);
  AMQPClient.Host := 'rabbitmq.example.com';
  AMQPClient.Port := 5672;
  AMQPClient.Authentication.Username := 'guest';
  AMQPClient.Authentication.Password := 'guest';
  AMQPClient.VirtualHost := '/';

  AMQPClient.OnAMQPConnect := OnAMQPConnect;
  AMQPClient.OnAMQPMessage := OnAMQPMessage;
  AMQPClient.Connect;
end;

procedure TForm1.OnAMQPConnect(Sender: TObject);
begin
  AMQPClient.OpenChannel(1);
  AMQPClient.DeclareQueue(1, 'orders',
    False, True, False, False);
  AMQPClient.BasicConsume(1, 'orders',
    'consumer-1', False, False, False, False);
end;

procedure TForm1.OnAMQPMessage(Sender: TObject;
  aChannel: Integer; aMessage: TsgcAMQPMessage);
begin
  Memo1.Lines.Add('Received: ' + aMessage.Body);
  AMQPClient.BasicAck(aChannel, aMessage.DeliveryTag, False);
end;

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Ready to Get Started with AMQP 0.9.1?

Download the free trial and connect to RabbitMQ in minutes.