RabbitMQ 简单总结

Queue

message buffer. consumer reads messages from Queue.

Exchange

producer sends messages to Exchange. And Exchange will route messages to Queues.

types

  • direct. 只能exactly match routing key 到binding key 上
  • fanout. 向所有bind 上的queue 发送,忽略routing key
  • topic. 可以根据topic ( 带通配符的binding key) 来route 消息

Message

message carries a routing key. eg. "log", "quick.brown.fox"

Routing Key

Exchange uses Routing Key to decide wich queue the message should be delivered to.

Bind

bind a queue to a specific exchange ( and possibly a binding key)

binding key

the key/pattern exchange uses to match a routing key

Topic

带通配符的binding key. * - matches a word. # - matches 0 or more words

eg.

[producer] -[Msg (routing key "error"/"info")]
            |
            -> [Exchange "log"] -[Msg "error"]-> [Queue (bind Exchange log, key "error")]
                |
                -> [Msg "info"] -> [Queue (bind exchange "log", key "info"]

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容