AMQP Protocol

Advanced Message Queuing Protocol for reliable enterprise messaging. Full support for AMQP 0.9.1 and 1.0, compatible with RabbitMQ and Azure Service Bus.

What is AMQP?

AMQP is an open standard for enterprise messaging that provides reliable, interoperable message delivery across different platforms and implementations.

Enterprise-Grade Message Queuing

AMQP defines a wire-level protocol for message-oriented middleware, ensuring true interoperability between different vendor implementations. Its sophisticated routing model based on exchanges, queues, and bindings supports complex messaging patterns including direct routing, topic-based routing, fan-out, and header-based routing. sgcWebSockets implements both AMQP 0.9.1 (the widely-deployed version used by RabbitMQ) and AMQP 1.0 (the OASIS standard used by Azure Service Bus), giving you maximum flexibility.

  • Wire-level protocol guarantees cross-vendor interoperability
  • Flexible routing with exchanges, queues, and bindings
  • Guaranteed message delivery with acknowledgments
  • Both AMQP 0.9.1 and 1.0 supported
PRODUCER EXCH Q1 Q2 CONSUMER

AMQP Features

Industrial-strength messaging features for mission-critical applications.

Reliable Message Delivery

Messages are never lost with publisher confirms and consumer acknowledgments ensuring end-to-end delivery guarantees.

Exchange/Queue/Binding Model

Flexible routing through direct, topic, fanout, and headers exchanges bound to queues with configurable routing keys.

Message Acknowledgment

Consumers explicitly acknowledge processed messages. Unacknowledged messages are automatically requeued for redelivery.

Transactions

Group publish and acknowledge operations into atomic transactions that either all succeed or all roll back.

Flow Control

Built-in flow control prevents fast producers from overwhelming slow consumers, ensuring stable system performance.

Channel Multiplexing

Multiple logical channels over a single TCP connection, reducing connection overhead while maintaining isolation.

RabbitMQ & Azure Service Bus

Tested and verified with RabbitMQ (AMQP 0.9.1) and Azure Service Bus (AMQP 1.0) for production deployments.

AMQP Use Cases

Mission-critical messaging scenarios where reliability and interoperability matter most.

Financial Transaction Processing

Process financial transactions with guaranteed delivery and exactly-once semantics for banking and payment systems.

Order Management

Manage order workflows with reliable message queuing between order entry, fulfillment, shipping, and notification systems.

Enterprise Service Bus

Build an enterprise service bus connecting disparate systems with reliable, asynchronous message delivery.

Distributed Computing

Distribute work across multiple processing nodes with task queues and result collection patterns.

Audit Logging

Capture and route audit events to logging systems with guaranteed delivery, ensuring no audit trail entries are lost.

Delphi AMQP Example

Connect to an AMQP broker, declare queues, and exchange 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 := '/';

  // Set up event handlers
  AMQPClient.OnAMQPConnect := OnAMQPConnect;
  AMQPClient.OnAMQPMessage := OnAMQPMessage;
  AMQPClient.Connect;
end;

procedure TForm1.OnAMQPConnect(Sender: TObject);
begin
  // Open a channel
  AMQPClient.OpenChannel(1);

  // Declare a queue
  AMQPClient.DeclareQueue(1, 'orders',
    False, True, False, False);

  // Start consuming messages
  AMQPClient.BasicConsume(1, 'orders',
    'consumer-1', False, False, False, False);
end;

procedure TForm1.OnAMQPMessage(Sender: TObject;
  aChannel: Integer; aMessage: TsgcAMQPMessage);
begin
  // Process the message
  Memo1.Lines.Add('Received: ' + aMessage.Body);

  // Acknowledge the message
  AMQPClient.BasicAck(aChannel, aMessage.DeliveryTag, False);
end;

procedure TForm1.ButtonPublishClick(Sender: TObject);
begin
  // Publish a message to the default exchange
  AMQPClient.BasicPublish(1, '', 'orders',
    '{"orderId": 67890, "total": 99.95}');
end;

Ready to Get Started with AMQP?

Download the free trial and connect to enterprise message brokers in minutes.