MQ|回顾RabbitMQ声明队列的参数

一 引入的POM依赖

com.rabbitmq amqp-client 3.6.5

二 声明队列的源码
package com.rabbitmq.client; public interface Channel extends ShutdownNotifier {//声明队列 Queue.DeclareOk queueDeclare(String queue, boolean durable, boolean exclusive, boolean autoDelete,Map arguments) throws IOException; }

三 源码中的注释
Declare a queue
Params:
queue – the name of the queue
durable – true if we are declaring a durable queue (the queue will survive a server restart)
exclusive – true if we are declaring an exclusive queue (restricted to this connection)
autoDelete – true if we are declaring an autodelete queue (server will delete it when no longer in use)
arguments – other properties (construction arguments) for the queue
Returns:
a declaration-confirm method to indicate the queue was successfully declared
Throws:
IOException – if an error is encountered
See Also:
AMQP.Queue.Declare, AMQP.Queue.DeclareOk
中文注释:
queue:队列的名称。
durable:队列是否持久化,如果为true,rabbitmq服务重启该队列仍然存在。
exclusive:(独占)声明队列同一时间只能保证一个连接,且该队列只有被这一个连接使用。
autoDelete:自动删除的队列,当该队列没有任何的关联时,就会被自动删除。
arguments:扩展参数。
【MQ|回顾RabbitMQ声明队列的参数】

    推荐阅读