link: Real-Time Notification Architectures, Message brokers

AMQP (Advanced Message Queuing Protocol)

Overview

AMQP (Advanced Message Queuing Protocol) is an open standard protocol for message-oriented middleware. It enables the reliable exchange of business messages between different applications or systems. AMQP is designed to support various messaging patterns and provide features like message queuing, routing, reliability, and security.

Key Features

Summary

  • Reliability: Ensures messages are delivered once and only once.
  • Interoperability: Allows different systems to communicate regardless of the language or platform they use.
  • Flexibility: Supports a wide range of messaging patterns, including point-to-point, publish/subscribe, and more.
  • Security: Provides mechanisms for secure message transmission through authentication and encryption.
  • Flow Control: Manages the rate of message delivery to prevent overwhelming consumers.

How It Works

  1. Producers: Applications or services that send messages.
  2. Consumers: Applications or services that receive messages.
  3. Brokers: Middleware that routes and stores messages. Common AMQP brokers include RabbitMQ and Apache Qpid.
  4. Exchanges: Receives messages from producers and routes them to queues based on rules called bindings.
  5. Queues: Buffers that store messages until they are processed by consumers.
  6. Bindings: Rules that define the relationship between exchanges and queues.

AMQP vs. Message Queuing Telemetry Transport

FeatureAMQPMQTT
Protocol TypeMessage queuing protocolLightweight publish/subscribe messaging protocol
Designed ForHigh reliability and enterprise messagingLow bandwidth and constrained environments
Message SizeSupports large message payloadsOptimized for small message payloads
QoS LevelsEnsures exactly once deliveryOffers three QoS levels: at most once, at least once, exactly once
OverheadHigher due to extensive featuresLower due to simplicity
UsageEnterprise systems, financial services, supply chainIoT, mobile applications, sensor networks
SecurityRobust security features including authentication and encryptionBasic security features; often relies on underlying transport layer
Transport ProtocolTCPTCP, WebSockets