Message Attributes and Payload:
messages可以以persistent的形式发布,这样,message会被broker保存到disk,当broker重启时,不会丢失,如果只是简单是把message发布到durable exchange或者route到durable queue,并不能保证message 的持久性,而是完全取决于message本身的persistent mode(Delivery mode),但是以persistent model发布message会影响性能。
AMQP 0-9-1 Methods
exchange:
- exchange.declare publisher----->broker
- exchange.declare-ok broker----->publisher
- exchange.delete publisher----->broker
- exchange.delete-ok broker----->publisher
queue:
- queue.declare consumer----->broker
- queue.declare-ok: broker----->consumer
Connections
应用层协议,基于TCP连接,当不需要connection时,只需要close connection,而不是不停的开关tcp连接。
channels:
解决的场景是一个consumer需要与broker建立多个connections的时候,这样要维护多个TCP连接,并且TCP连接数目是有限的,消耗资源比较多,这样channels就出现了,相当于light-weight的connection,共享同一个TCP connection
常见应用场景:consumer使用多线程或者进程处理messages的时候,建议为每一个线程或者进程建立一个channel来分别处理,而不要share channels between threads/processes,不同的channels之上的通信上下文是完全独立的,只是共享了一个TCP连接。
Virtual Hosts
应用场景:一个broker host多个完全分离的不同的环境(groups of users, exchanges,queues and so on)通过vhosts, AMQP clients在建立connection的时候可以通过vhosts来指定连接到哪个vhosts
AMQP is Extensible 扩展AMQP功能
Custom exchange types 定制exchange type,如果之前提供的四种exchange type不能很好地满足要求
Brokers can be extended with additional plugins: broker的功能是可插式的,通过不同的插件来扩展broker的功能。
AMQP 0-9-1 Clients Ecosystem
Some of the clients are asynchronous(non-blocking), some are synchronous (blocking), some supportboth models. Some clients support vendor-specific extensions(for example, RabbitMQ-specific extensions).
详情请参考官网:http://www.rabbitmq.com/tutorials/amqp-concepts.html