The Advanced Message Queuing protocol (amqp)Is a standard open application-layer Message Middleware (Message Oriented Middleware) Protocol.AmqpDefines the data format of byte streams sent over the network. So the compatibility is very good, any implementationAmqpProtocolProgramAndAmqpOther programs that are compatible with the protocol can easily interact across languages and platforms.
Development
Amqp By JPMorgan Chase & Co Yu 2006 Released in mid-year. JPMorgan Chase & Co And Imatix Define protocol specifications, including Red Hat, Cisco Systems, twist, Iona, and imatix Participate in development. As 2009 Year 11 Month, members of the working group include Bank of America, Barclays, Cisco Systems, Credit Suisse, Deutsche B Ö RSE systems, envoy Technologies, Inc ., goldman Sachs, Progress Software, imatix Corporation, JPMorgan Chase Bank Inc. n. a, Microsoft Corporation, Novell, rabbit Technologies Ltd ., red Hat, inc ., solace systems, tervela inc ., twist process innovations Ltd, ws02 and 29 West Inc.
It is worth mentioning that,AmqpThe design goal is to establish an open industrial standard agreement. AlthoughAmqpOriginated from the financial service industry, but its purpose is not limited to the financial industry.
The amqp Model
Distributed Model
AmqpDefines a series of entities(Entity),From the connection perspective,They are
Message Broker:ConnectionClientServer, which usesAmqpProtocol andClientAnd can run as a cluster, But these details are not writtenAmqp.
User: Users can connectMessage Broker
Connection: Physical connection,Bind to user
channel : channel is a stateful logical connection. client parallel operations on connections should maintain different channels .
all sent and received entities ( entity ) All in channel . Any entity that tries to declare a name with different attributes ( entity ) , both cause errors. If you want to change the properties of an object ( entity , You must delete the entity first and then redefine it. Entity ( entity ) names must be unique, broker subject to entity ( entity client .
Exchanges
ExchangeSlaveClientReceive messages and distribute themMessage Queue
ExchangeAttributes
Passive: ExchangeIt does not need to be declared, but if it does not exist, an error will occur.
Durable: IfBrokerRestart,ExchangeValid?
Auto-delete: As long as it is found that it is not boundQueue,ExchangeWill be deleted.
Queues
QueueUsed for storageMessageUntil a client can process thisMessage.
QueueAttributes
Alternate-exchange: When the message is rejected, it will be forwarded to thisExchange, And fromQueue.
Passive: queueDo not be declared, But if it does not exist, Will produce errors
Durable: IfBrokerRestart,QueueValid?
Exclusive: Only oneClientA specificQueue.
Auto-delete: IfQueueNot subscribed, Automatically deletedQueue
Messages
MessageAll are not named and sentExchange. They are composedMessage HeaderAndMessage Content.BodyIs an invisible object that contains several optional attributes.Message Header:
Routing-Key: This attribute depends onExchangeType
Immediate: IfMessageCannot be processed immediately, Then it is treatedUnroutable
Delivery-Mode: IndicatesMessageWhether persistent storage is required.
Priority:MessagePriority
Expiration:MessageHow long will it take to expire, And thenUnroutableProcessing
Bindings
BindingIsQueueAndExchangeAnd specifyMessageHowExchangeSendQueue.
Unconditional: RequestExchangeAllMessage.
Conditional on a fixed string: RequestExchangeWith the specifiedRouting keyAllMessage
Conditional on a pattern match: RequestExchangeWith the specifiedRouting key, And meets the specifiedPatternAllMessage
Conditional on multiple fixed strings: RequestExchangeAllMessage
Conditional on multiple fixed strings: RequestExchangeAllMessage
Conditional on algorithmic comparison: RequestExchangeAboveAlgorithmAll requiredMessage
Conditional on Content Inspection: RequestExchangeAllMessage
Implementations
These are the known publicly available amqp implementations:
Openamq, original open-source implementation of amqp, written in C by imatix. runs on Linux, Aix, Solaris, windows, OpenVMS. schemdes broker, APIs in C/C ++ and Java JMS, remote admin shell, scripting, Federation, failover, and amqp-over-HTTP via the restms protocol.
Apache qpid, a project in the Apache Foundation with client APIs that support C ++, Ruby, Java, JMS, Python and. net.
Red Hat Enterprise MRG implements the latest version of amqp 0-10 providing rich set of features like full management, Federation, active-active Clustering Using qpid as upstream, adds a Web console and embedded enterprise features and "c ++, Ruby, Java, JMS, Python. net "clients.
Rabbitmq, an independent open-source implementation. the server is written in Erlang, and multiple clients including python, Ruby ,. net, Java, JMS, C, PHP, actionscript, XMPP, stomp, and Ajax are provided. rabbitmq is distributed with Ubuntu, FreeBSD ports.
Amqp infrastructure Yum installable amqp 0-10 (maintained in the latest 3 versions of Fedora) which provided des the broker, management tools, agents and clients.
MQ, a high-performance messaging platform that is able to treat amqp-compliant brokers as nodes in Distributed messaging network.
Zyre, a broker that implements restms and amqp to provide restful HTTP access to amqp networks.
Reference:
Http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol