mq

rabbitmq笔记

mq

Posted by Deetch on October 25, 2018

exchange_declare

  1. exchange
  2. exchange_type
  3. passive:(1). true只检查存在与否, (2)false不存在就创建
  4. durable
  5. auto_delete:没有queue绑定后删除
  6. internal:是否可以被其它的exchange发布
  7. arguments

exchange_bind

  1. destination:目标exchange名
  2. source:源exchange名
  3. routing_key:
  4. arguments

queue_declare

  1. durable: queue在rabbitmqserver重启后是否依然存在
  2. exclusive: 只允许通过当前的connection进行连接
  3. auto_delete:在consumer取消消费或者断开连接时删除
  4. arguments:key/value arguments(map)

queue_bind

  1. queue:
  2. exchange:
  3. routing_key:
  4. arguments

basic_consume

  1. callback(channel, method, properties, body)

a. method.consumer_tag b. method.delivery_tag c. method.redelivered d. method.exchange e. method.routing_key

a. properties.content_type b. properties.content_encoding c. properties.headers d. properties.delivery_mode e. properties.priority f. properties.correlation_id g. properties.reply_to h. properties.expiration i. properties.message_id j. properties.timestamp k. properties.type l. properties.user_id m. properties.app_id n. properties.cluster_id

  1. queue:被消费的队列名称
  2. no_ack:是否自动ack
  3. exclusive:不允许其他的消费者消费
  4. consumer_tag:
  5. arguments:

basic_publish

  1. exchange:
  2. routing_key:
  3. body:
  4. properties:

a. properties.content_type b. properties.content_encoding c. properties.headers d. properties.delivery_mode e. properties.priority f. properties.correlation_id g. properties.reply_to h. properties.expiration i. properties.message_id j. properties.timestamp k. properties.type l. properties.user_id m. properties.app_id n. properties.cluster_id

  1. mandatory:如果消息不能被路由到队列上,若设置该标志,则消息返回给发送者,若没设置,则丢失
  2. immediate:如果队列已经有等待的消费者,则路由到队列上。若所有匹配的队列都没有消费者,则返回给发送者