rabbitmq¶
Install¶
Config¶
Concept¶
- Topics
Topic 实现 publish 和 subscribe .
publish => message => subscribers. 每个 active subscriber 都接收到一份 copy。
In JMS a Topic implements publish and subscribe semantics. When you publish a message it goes to all the subscribers who are interested - so zero to many subscribers will receive a copy of the message. Only subscribers who had an active subscription at the time the broker receives the message will get a copy of the message.
- Queues
Queue 实现 load balance . Queues implement a reliable load balancer
message => Queue => consumer.
如果没有consumer, 信息会keep在queue中,直到有avaiable consumer。 如果consumer 接收 message,但是没有acknowledge it, 便意外closing。 信息会 redelivered 给令一个consumer。
A queue can have many consumers with messages load balanced across the available consumers.
Hits¶
- 持久化: Durable
- 事务: txSelect/txCommit/txRollback
- Confirm
- acknowledgment
- 消息未完全持久化,当机器重启后,消息会全部丢失,甚至Queue也不见了