美文网首页
RabbitMQ 简单总结

RabbitMQ 简单总结

作者: lxian2shell | 来源:发表于2018-04-26 20:21 被阅读0次

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"]

相关文章

网友评论

      本文标题:RabbitMQ 简单总结

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