Skip to main content

Connection

AMQP 1.0 joins two containers by one connection, which carries sessions, and each session carries links that move messages one way.

One connection between the service and the broker: a session for the publishers, a session for each subscription, and links inside themOne TCP connectionSession: publishSession: ordersBroker containerService containercontainer id ruststreamSession windowshared by publishersSender linktarget receiptsone per addressSession windowof one subscriptionReceiver linksource orderscredit 256Node receiptsa queue or a topicNode ordersa queue or a topicLink names are unique per connection; the crate derivesthem from the container id, as in ruststream-receiver-3
The diagram as text
  1. One TCP connection: Session window shared by publishers; Sender link target receipts one per address; Session window of one subscription; Receiver link source orders credit 256
  2. Session: publish: Session window shared by publishers; Sender link target receipts one per address
  3. Session: orders: Session window of one subscription; Receiver link source orders credit 256
  4. Broker container: Node receipts a queue or a topic; Node orders a queue or a topic
  5. Service container container id ruststream → One TCP connection: TLS, SASL, open
  6. Sender link target receipts one per address → Node receipts a queue or a topic: transfers
  7. Node orders a queue or a topic → Receiver link source orders credit 256: transfers
  8. Link names are unique per connection; the crate derives them from the container id, as in ruststream-receiver-3

A container is a peer of the protocol: the service is one and the broker is another. The service presents the container id ruststream unless container_id names another, and a broker's console lists the service's connection and links under it.

The connection is one TCP socket. On an amqps:// URL it starts with TLS. SASL then authenticates the service with PLAIN, ANONYMOUS or EXTERNAL, and the two containers exchange open.

A session is a pair of channels inside the connection, each with a window that bounds the transfers in flight on it. The crate begins one session that every publisher of the connection shares, and one more for each subscription. A slow subscription fills its own window, never the publishers' one or another subscription's.

A link is named and carries messages in one direction. A sender link goes from the service to a node, and a receiver link from a node to the service. Each end of a link is a terminus, and the terminus on the broker's side names a node by its address. A link also has a credit of its own, which Transfers draws.

The standard fixes the frames on the wire, not what an address means. Whether orders is a queue or a topic is the broker's decision, which Addresses draws.

The model is the specification's (transport, security).