美文网首页
AMQP Protocol(摘自AMQP 1.0)

AMQP Protocol(摘自AMQP 1.0)

作者: MultiThread | 来源:发表于2019-12-24 16:56 被阅读0次

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:

  1. 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)
  2. 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:

  1. The "exchange*" receives messages from publisher applications and routes these to "message queues", based on arbitrary criteria, usually message properties or content.
  2. The "message queue" stores messages until they can be safely processed by a consuming client application (or multiple applications).
  3. 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:

  1. To support the semantics required by the financial services industry.
  2. To provide the levels of performance required by the financial services industry.
  3. To be easily extended for new kinds of message routing and queuing.
  4. To permit the server's specific semantics to be programmed by the application, via the protocol.
  5. 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 layers
2.2.1、AMQP Model 的需求:
  1. To guarantee interoperability between conforming implementations.
  2. To provide explicit control over the quality of service.
  3. To support any middleware domain: messaging, file transfer, streaming, RPC, etc.
  4. To accommodate existing open messaging API standards (for example, Sun's JMS).
  5. To be consistent and explicit in naming.
  6. To allow complete configuration of server wiring via the protocol.
  7. To use a command notation that maps easily into application-level API's.
  8. 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:

  1. To be compact, using a binary encoding that packs and unpacks rapidly.(二进制解压包)
  2. 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:

  1. 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.

  2. Connection: A network connection, e.g. a TCP/IP socket connection.

  3. 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.

  1. Client: The initiator of an AMQP connection or session. AMQP is not symmetrical. Clients produce and consume messages whereas servers queue and route messages.

  2. Server: The process that accepts client connections and implements the AMQP message queuing and routing functions. Also known as "broker".

  3. Peer: Either party in an AMQP dialog. An AMQP connection involves exactly two peers (one is the client, one is the server) .

  4. 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.

  5. Assembly: An ordered collection of Segments that form a logical unit of work.

  6. Segment: An ordered collection of Frames that together form a complete syntactic sub-unit of an Assembly.

  7. Frame: The atomic unit of transmission in AMQP. A Frame is an arbitrary fragment of a Segment.

  8. Control: A formally defined one-way instruction assumed to be unreliably transported.

  9. Command: A formally defined and identified instruction requiring acknowledgement. AMQP attempts to reliably transport Commands.

  10. 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.

  11. Header: A specific type of Segment that describes properties of message data.

  12. 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.

  13. Content: The message data contained within a body segment.

  14. Exchange: An entity within the server which receives messages from producer applications and routes these to message queues within the server.

  15. Exchange Type: The classification of an exchange based on routing semantics.

  16. Message Queue: A named entity that holds messages until they can be sent to consumer applications.

  17. 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.

  18. Routing Key: A message header that an Exchange may use to decide how to route a specific message.

  19. Durable: A server resource that survives a server restart.

  20. Transient: A server resource that is wiped or reset after a server restart.

  21. Persistent: A message that the server holds on reliable disk storage and MUST NOT lose after a server restart.

  22. Non-Persistent: A message that the server holds in memory and MAY lose after a server restart.

  23. Consumer: A client application that requests messages from a message queue.

  24. Producer: A client application that publishes messages to an exchange.

  25. 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.

3、The AMQP Model

AMQP Model

相关文章

网友评论

      本文标题:AMQP Protocol(摘自AMQP 1.0)

      本文链接:https://www.haomeiwen.com/subject/tduxoctx.html