exchange_declare
- exchange
- exchange_type
- passive:(1). true只检查存在与否, (2)false不存在就创建
- durable
- auto_delete:没有queue绑定后删除
- internal:是否可以被其它的exchange发布
- arguments
exchange_bind
- destination:目标exchange名
- source:源exchange名
- routing_key:
- arguments
queue_declare
- durable: queue在rabbitmqserver重启后是否依然存在
- exclusive: 只允许通过当前的connection进行连接
- auto_delete:在consumer取消消费或者断开连接时删除
- arguments:key/value arguments(map)
queue_bind
- queue:
- exchange:
- routing_key:
- arguments
basic_consume
- 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
- queue:被消费的队列名称
- no_ack:是否自动ack
- exclusive:不允许其他的消费者消费
- consumer_tag:
- arguments:
basic_publish
- exchange:
- routing_key:
- body:
- 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
- mandatory:如果消息不能被路由到队列上,若设置该标志,则消息返回给发送者,若没设置,则丢失
- immediate:如果队列已经有等待的消费者,则路由到队列上。若所有匹配的队列都没有消费者,则返回给发送者