http://www.amqp.org/specification/0-10/amqp-org-download
1、什么是AMQP
AMQB, advanced message queue protocol.
The Advanced Message Queuing Protocol (AMQP) enables full functional interoperability(互通性) between conforming clients
and messaging middleware servers (also called "brokers").
2、AMQP定义的内容
AMQP, defines both the network protocol and the broker services through:
- A defined set of messaging capabilities called the "Advanced Message Queuing Protocol Model" (AMQP Model).
The AMQP Model consists of a set of components that route and store messages within the broker, plus a set of rules for wiring these components together.(Server) - A network wire-level protocol, AMQP, that lets client applications talk to the broker and interact with the AMQP Model it implements.(network protocol)
2.1、The AMQP Model
功能
There are three main types of component, which are connected into processing chains in the server to create the desired
functionality:
- The "exchange*" receives messages from publisher applications and routes these to "message queues", based on arbitrary criteria, usually message properties or content.
- The "message queue" stores messages until they can be safely processed by a consuming client application (or multiple applications).
- The "binding" defines the relationship between a message queue and an exchange and provides
the message routing criteria.
预期目标
The AMQP model was conceived with the following goals:
- To support the semantics required by the financial services industry.
- To provide the levels of performance required by the financial services industry.
- To be easily extended for new kinds of message routing and queuing.
- To permit the server's specific semantics to be programmed by the application, via the protocol.
- To be flexible yet simple.
The AMQP protocol is a binary protocol with modern features: it is multi-channel, negotiated, asynchronous, secure, portable, neutral, and efficient.
2.2、The AMQP Protocol
AMQP is usefully split into three layers2.2.1、AMQP Model 的需求:
- To guarantee interoperability between conforming implementations.
- To provide explicit control over the quality of service.
- To support any middleware domain: messaging, file transfer, streaming, RPC, etc.
- To accommodate existing open messaging API standards (for example, Sun's JMS).
- To be consistent and explicit in naming.
- To allow complete configuration of server wiring via the protocol.
- To use a command notation that maps easily into application-level API's.
- To be clear, so each operation does exactly one thing.
The design of the AMQP transport layer was driven by these main requirements, in no particular order:
- To be compact, using a binary encoding that packs and unpacks rapidly.(二进制解压包)
- To handle messages of any size without significant limit.(传输层无大小限制)
2.3 Technical Terminology
The following terms have special significance within the context of this document:
-
AMQP Model: A logical framework representing the key entities and semantics which must be made available by an AMQP compliant server implementation, such that the server can be meaningfully manipulated by AMQP Commands sent from a client in order to achieve the semantics defined in this specification.
-
Connection: A network connection, e.g. a TCP/IP socket connection.
-
Session: A named dialog between peers. Within the context of a Session, exactly-once delivery is guaranteed.
4.Channel: An independent bidirectional stream within a multiplexed connection. The physical transport for a connected session.
-
Client: The initiator of an AMQP connection or session. AMQP is not symmetrical. Clients produce and consume messages whereas servers queue and route messages.
-
Server: The process that accepts client connections and implements the AMQP message queuing and routing functions. Also known as "broker".
-
Peer: Either party in an AMQP dialog. An AMQP connection involves exactly two peers (one is the client, one is the server) .
-
Partner: The term Partner is used as a convenient shorthand for describing the "other" Peer when describing an interaction between two Peers. For example if we have defined Peer A and Peer B as opposite ends of a given interaction, then Peer B is Peer A's Partner and Peer A is Peer B's partner.
-
Assembly: An ordered collection of Segments that form a logical unit of work.
-
Segment: An ordered collection of Frames that together form a complete syntactic sub-unit of an Assembly.
-
Frame: The atomic unit of transmission in AMQP. A Frame is an arbitrary fragment of a Segment.
-
Control: A formally defined one-way instruction assumed to be unreliably transported.
-
Command: A formally defined and identified instruction requiring acknowledgement. AMQP attempts to reliably transport Commands.
-
Exception: A formally defined error condition that may occur during execution of one or more commands.
15.Class: A collection of AMQP commands or controls that deal with a specific type of functionality. -
Header: A specific type of Segment that describes properties of message data.
-
Body: A specific type of Segment that contains application data. Body segments are entirely opaque - the server does not examine or modify these in any way.
-
Content: The message data contained within a body segment.
-
Exchange: An entity within the server which receives messages from producer applications and routes these to message queues within the server.
-
Exchange Type: The classification of an exchange based on routing semantics.
-
Message Queue: A named entity that holds messages until they can be sent to consumer applications.
-
Binding: A relationship that defines routing between a Message Queue and an Exchange.
23.Binding Key: A name for a binding. Some exchange types may use this as a pattern that defines the routing behavior for the Binding. -
Routing Key: A message header that an Exchange may use to decide how to route a specific message.
-
Durable: A server resource that survives a server restart.
-
Transient: A server resource that is wiped or reset after a server restart.
-
Persistent: A message that the server holds on reliable disk storage and MUST NOT lose after a server restart.
-
Non-Persistent: A message that the server holds in memory and MAY lose after a server restart.
-
Consumer: A client application that requests messages from a message queue.
-
Producer: A client application that publishes messages to an exchange.
-
Virtual Host: A collection of exchanges, message queues and associated objects. Virtual hosts are independent server domains that share a common authentication and encryption environment. The client application chooses a virtual host after logging in to the server.
网友评论