What is AMQP (Advanced Message Queuing Protocol)?
Updated: Oct 27

AMQP (Advanced Message Queuing Protocol) is a binary application protocol for exchanging messages between software systems. It defines how communicating endpoints represent messages, control their transfer and report delivery outcomes. A typical deployment connects producers and workers through a message broker, but AMQP 1.0 also supports direct communication between peers. AMQP is a protocol, rather than a particular broker product or a type of broadband connection.
Its most useful distinction is between handing a message to another system and completing the work described by that message. An application can successfully submit an invoice job to a broker while the worker that generates the invoice is offline. Understanding that boundary makes AMQP easier to configure, compare and troubleshoot.
Which AMQP version are we talking about?
AMQP 1.0 became an OASIS Standard on 29 October 2012. AMQP 0-9-1 is a different messaging protocol with a different model, despite the similar name. They are not wire-compatible versions that a client can substitute without checking its library and server configuration. Documentation headed simply “AMQP” therefore needs a version check before its examples are used.
This guide explains AMQP 1.0, then labels RabbitMQ and 0-9-1 details separately. The OASIS AMQP transport specification defines the peer-to-peer transfer model. It does not require every broker to expose identical queue-management APIs or interpret destination addresses in the same way.
Question | Important distinction |
|---|---|
AMQP 1.0 | Defines interoperable message transfer and a message format, independent of one broker architecture. |
AMQP 0-9-1 | Defines a broker model with exchanges, queues and bindings, alongside its protocol operations. |
A broker supports both | Choose a matching client library and protocol. Sharing a listening port does not make the protocols interchangeable. |
Moving between products | Check addresses, authentication, topology, supported outcomes, recovery and durability, as well as the protocol label. |
For example, RabbitMQ 4.2 documents native AMQP 1.0 support, introduced in RabbitMQ 4.0, alongside 0-9-1. Its AMQP 1.0 implementation still maps addresses onto RabbitMQ resources. That is a product implementation of the protocol, not evidence that all AMQP 1.0 systems use RabbitMQ’s exchange and binding model.
The pieces inside an AMQP 1.0 connection
An AMQP container is an application or broker participating in communication. Inside it, a node represents something that produces, consumes, stores or forwards messages. A queue is one possible node. A link gives messages a one-way route from a source to a target; the source tracks outgoing deliveries and the target tracks incoming deliveries.
The network connection carries frames in both directions. Within it, sessions organise conversations and control the allowance for transfer frames. Links sit within sessions and control message delivery. Several links can share a session, and several sessions can share a connection, subject to negotiated limits. These layers allow separate message flows without requiring a new TCP connection for every job.
Connection: the communication relationship between containers, normally carried over TCP, with TLS where configured.
Session: a bidirectional conversation made from a pair of channels, with transfer-frame flow control.
Link: a unidirectional message route with a source, a target and receiver-controlled message credit.
Delivery: one tracked attempt to transfer a message over a link. The message and its delivery state are different things.
Connection setup establishes the protocol and security arrangements, then exchanges capabilities and limits. AMQP uses open for the connection, begin for a session and attach for a link. Flow communicates available allowance, transfer carries message data, and disposition reports delivery state. Client libraries usually handle these frames, but logs containing their names can reveal which layer failed.
A successful TCP connection only establishes a transport path. It does not prove that authentication worked, the requested node exists, a link attached successfully or a worker processed a message. A message broker is the intermediary service that applies routing and storage policy; AMQP is one way applications communicate with it.
Follow one job from producer to worker
Imagine a UK business submitting a job identified as invoice-042 to a hosted broker. A worker will generate the invoice later. The following example assumes an existing queue, a compatible client, appropriate permissions and delivery outcomes enabled. It illustrates the lifecycle rather than prescribing a universal broker configuration.
The producer creates a message containing the job data and a stable application identifier. It attaches a sending link to the appropriate target.
The broker, acting as receiver on that link, grants credit. The producer transfers the message when the link and session allowances permit it.
The broker reports the delivery outcome. An accepted outcome at this boundary means the broker accepted responsibility under the target’s supported policy. It does not mean the invoice already exists.
The worker attaches a receiving link to the queue and grants credit. The broker now acts as sender on this separate link.
The worker receives the job and performs the required operation. The application decides what must be safely recorded before it reports successful processing.
The worker reports its outcome to the broker. Delivery tracking is settled according to the negotiated settlement modes and application behaviour.
There are two hand-offs: producer to broker, then broker to worker. The first can succeed long before the second. If the producer needs confirmation that the invoice was generated, design a separate business response or status lookup with a correlation identifier. Do not interpret the broker’s acceptance as that response.
The AMQP message format separates standard properties, application properties and the body from delivery-related information. A body might contain JSON bytes, while properties identify the message or correlate a reply. AMQP does not force every application payload to be JSON, and knowing the wire protocol does not establish the meaning of a proprietary payload.
Keep the business identifier separate from transport delivery identifiers. A delivery tag identifies a delivery attempt in the link’s tracking context; it is not a universal invoice number. The same logical job can be delivered again, through a new attempt, after a failure. A stable application identifier lets the receiving system recognise the job across those attempts.
How receiver credit controls message delivery
AMQP 1.0 link credit lets the receiver say how many messages it is prepared to accept on a link. The sender must respect that allowance. This gives a worker a way to avoid being flooded with more deliveries than its processing policy can accommodate, rather than relying only on the operating system’s TCP buffers.
Suppose a receiver grants credit for 50 messages. With no replenishment or other flow-state change, sending five messages consumes five units of that allowance, leaving 45. One large message can occupy multiple transfer frames while still consuming one message credit. Credit is therefore not a byte limit, and it should not be confused with the separate session window for transfer frames.
If each of those 50 messages contains a 10 kB body, using decimal units, their bodies total 500,000 bytes. That is an illustration of body data associated with the allowance, not a guarantee that the receiver uses only 500 kB of memory. Properties, framing, decoded objects, library buffers, concurrent links and the application’s own work can add substantially more.
Receiving or settling a message does not inherently grant fresh credit. The receiver or its library updates credit according to its policy. A receiver can pause further delivery by advertising zero credit, but transfers already in flight can still arrive before the sender has processed the update. Likewise, positive link credit alone does not guarantee progress if the session’s transfer-frame window is exhausted.
Most importantly, worker credit does not by itself cap the broker’s entire backlog. Producers may still be adding work to the broker. Queue capacity, message expiry, producer backpressure and overload policy need their own design. The queue system guide explains why controlling deliveries to workers and controlling stored work are separate operational tasks.
Outcomes and settlement answer different questions
A delivery outcome reports what happened at the receiving endpoint. Settlement concerns whether an endpoint can forget the delivery state it was tracking. They cooperate, but they are not interchangeable names for a database commit. The OASIS messaging specification defines the outcome types; the exact application and broker actions around them still need to be understood.
Outcome | Meaning at the receiving boundary |
|---|---|
Accepted | The receiver indicates successful processing for this hand-off. Ask which receiver and which policy this covers. |
Rejected | The message is invalid or unprocessable at this target. Investigate the reason rather than repeatedly retrying unchanged data. |
Released | The receiver has not processed the message and releases responsibility. Subsequent routing or redelivery depends on the node and policy. |
Modified | Processing was unsuccessful with additional information about the message or delivery. Support and consequences vary by implementation. |
For RabbitMQ 4.2, a producer receiving accepted means the routed queues accepted the message. A consumer reporting accepted tells the broker that its processing succeeded, allowing the message to be removed. These are separate exchanges. The version’s documentation also describes different requeue and dead-letter behaviour for other outcomes, so copying a generic outcome table is not enough to configure a live service.
The uncertain gap after a failure
Now suppose the worker commits invoice-042 to a database, then loses its connection before the broker receives the successful outcome. The broker cannot infer from the broken connection whether the invoice was committed. Retrying the job can preserve delivery while repeating the operation unless the application protects against that repeat.
A suitable design can record the job identifier and its result atomically with the intended database change, then recognise a later delivery as already applied. This is an application design requiring the destination’s transaction and concurrency guarantees. Merely checking an identifier first, then writing the effect separately, can leave a race between workers.
Idempotency is useful at this boundary because the goal is a controlled business effect, even when delivery attempts repeat. Setting an AMQP message-id property alone does not require every broker to deduplicate messages: the specification permits broker deduplication but does not mandate it. Check the actual product contract and any deduplication window.
AMQP 1.0 includes settlement and recovery mechanisms that can support precise delivery guarantees within a defined scope. That is not a universal promise that an arbitrary payment, email and database write happen exactly once. RabbitMQ 4.2 explicitly lists link suspension and resumption, exactly-once delivery and AMQP 1.0 transactions among its unsupported features. A protocol capability must also exist in the deployed implementation.
Durability is a policy, not a magic checkbox
The AMQP 1.0 durable message header has a defined requirement: an intermediary must not lose an accepted durable message merely because it terminates unexpectedly and restarts. A target unable to honour that requirement must not accept such a message. However, selecting message durability is not the same as configuring a replicated queue, independent backups or recovery from the loss of an entire site.
Check the node’s lifetime, persistence and replication behaviour as well as the message setting. Message expiry, explicit deletion and configured capacity policies are separate reasons that work may cease to be available. A system that intentionally expires a stale status update has a different requirement from one that must retain a financial job until it is resolved.
Treat an unprocessable message as a separate failure case. Endless immediate retries can consume capacity without making progress. Configure an appropriate retry policy, a destination for failed work where supported, and an alert that preserves enough diagnostic context without exposing sensitive payloads. The exact controls belong to the broker and application, rather than one universal AMQP administration interface.
An original backlog calculation: why credit is not capacity
Consider a deliberately simplified queue starting empty. Producers submit 120 jobs per second, while workers complete 80 per second, for 30 seconds. Assume steady rates, identical jobs, sufficient storage and no retries, expiry or failures. The queue grows by 40 jobs per second, leaving 1,200 waiting jobs after the burst.
Next, submissions fall to 40 jobs per second while workers still complete 80. The spare capacity is now 40 jobs per second, so clearing the 1,200-job backlog takes another 30 seconds. Dividing the backlog by the full 80-job service rate would incorrectly predict 15 seconds because it ignores new arrivals.
Phase | Ideal queue behaviour |
|---|---|
First 30 seconds | 120 arrivals/s minus 80 completions/s = 40 extra jobs/s; backlog reaches 1,200. |
Following 30 seconds | 80 completions/s minus 40 arrivals/s = 40 jobs/s of net drainage; backlog returns to zero. |
If arrivals stay at 80/s | There is no spare service capacity to drain the existing backlog in this ideal model. |
If arrivals stay above 80/s | The backlog keeps growing until a limit, policy or resource bottleneck intervenes. |
These are arithmetic illustrations, not broker benchmarks or measurements of a Techie Broadband connection. Real systems have variable job sizes, batching, storage costs, retries and uneven service times. Queue depth also does not directly reveal how old the oldest job is, so monitor age and processing latency alongside counts.
More broadband capacity helps if message transfer is the limiting stage. It does not make a CPU-bound worker or a slow database process more jobs per second. Increasing credit can improve utilisation when a worker waits for deliveries, but can also increase buffered work and the amount needing recovery after a failure. Tune the constrained stage rather than maximising every setting.

Security and operation across a broadband connection
AMQP security needs several separate decisions. TLS protects traffic in transit between its endpoints. SASL provides an authentication framework whose actual mechanism must be supported and configured. Resource authorisation decides what an authenticated identity may publish to or consume from. An encrypted connection does not automatically give the right permissions, and a password mechanism does not by itself provide encryption.
The conventional ports are 5672 for AMQP and 5671 for a TLS service, but deployments can use other ports. RabbitMQ 4.2 requires SASL for AMQP 1.0 connections and supports several authentication approaches. Its documented TLS behaviour should be checked alongside the client’s certificate validation and connection configuration. A port number alone is not proof of security or protocol compatibility.
Validate the server certificate and hostname rather than disabling verification to suppress an error.
Give producer and consumer identities only the destinations and operations they need.
Keep credentials and personal message content out of shared diagnostic logs.
Set appropriate message-size, storage and connection limits, and watch for repeated failures or authentication attempts.
Plan reconnect delays and recovery so many clients do not hammer the broker simultaneously after an outage.
For a UK business connecting to a remote broker, broadband outages, Wi-Fi contention, upstream saturation and a congested path can delay transfers or trigger reconnects. Monitor the local network and application together. A queue can buffer some interruptions under its configured policy, but it cannot create an unlimited store or prove that an interrupted worker performed no action.
AMQP, MQTT or HTTP? Start with the exchange you need
MQTT is often useful for topic-based telemetry and device messaging. AMQP 1.0 provides a rich message-transfer model with receiver credit and delivery-state control. HTTP provides request and response semantics widely used by web services. These are useful starting points, not rigid limits: application patterns and product capabilities can overlap.
Choose by asking who holds responsibility while the other party is unavailable, whether independent subscribers need copies or workers should share jobs, how failures are recovered, and what each success response proves. Also check client support, operational complexity and payload size. There is no defensible universal claim that AMQP is always faster, slower or more reliable than the alternatives.
A practical diagnostic path for stuck messages
Confirm the protocol version and client library. A working TCP connection with a mismatched AMQP library is not a working messaging integration.
Check TLS negotiation, certificate validation and authentication separately. Preserve the specific error while redacting secrets.
Inspect the requested address, permissions and link attachment outcome. For RabbitMQ, use its version-specific address rules rather than another broker’s queue naming assumptions.
If the link exists but nothing moves, inspect receiver credit and session flow control, then check whether a consumer is actually available.
Separate producer outcomes from consumer outcomes. Check failed routing, rejection, redelivery and any pending business response rather than treating them as one success flag.
Compare arrival rate, completion rate, queue depth and oldest-message age. Establish the bottleneck before changing credit, adding bandwidth or replaying work.
Avoid deleting a queue or repeatedly resending uncertain jobs merely to make a dashboard look clear. Preserve identifiers and inspect what the system already accepted or applied. A reconnect can restore communication while leaving earlier deliveries in doubt; the recovery procedure must account for that ambiguity.
Frequently asked questions
Is AMQP the same as RabbitMQ?
No. AMQP is a messaging protocol family; RabbitMQ is a broker product that supports AMQP 1.0, AMQP 0-9-1 and other protocols. Its queue types, address rules and management features are product-specific.
Does AMQP always need a broker?
AMQP 1.0 supports direct peer communication as well as broker-based messaging. A broker is useful when routing, buffering and independently available producers and consumers are required, but it is not mandatory for every AMQP 1.0 exchange.
Does AMQP guarantee that a job runs exactly once?
Not as an unconditional end-to-end business guarantee. Delivery guarantees depend on settlement, recovery, implementation support and the stated boundary. External effects need suitable transactional or idempotent handling, particularly when a connection fails after work is committed but before its outcome is received.
Will faster broadband clear a message backlog?
It can help when network transfer is the bottleneck. If workers or their database are already at capacity, faster transport alone will not increase completion rate. Compare arrivals with completions and inspect the age of queued work before choosing a remedy.
What to remember
AMQP 1.0 makes message hand-offs explicit: a receiver grants delivery capacity, endpoints exchange message data and outcomes, and settlement retires delivery tracking. The engineering task is to align those hand-offs with storage, recovery and the business effect. Check the version, identify which receiver accepted the message, and measure the stage that is actually holding up the work.

