一 引入的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:队列的名称。【MQ|回顾RabbitMQ声明队列的参数】
durable:队列是否持久化,如果为true,rabbitmq服务重启该队列仍然存在。
exclusive:(独占)声明队列同一时间只能保证一个连接,且该队列只有被这一个连接使用。
autoDelete:自动删除的队列,当该队列没有任何的关联时,就会被自动删除。
arguments:扩展参数。
推荐阅读
- RabbitMQ|RabbitMQ到底是什么()
- java|字节跳动岗位薪酬体系曝光,看完感叹(我酸了)
- RabbitMQ|RabbitMQ,RocketMQ,Kafka 事务性,消息丢失,消息顺序性和消息重复发送的处理策略问题
- rabbitmq|初学rabbitmq总结
- linux|Linux 安装项目软件 MySql Redis Nginx RabbitMQ Docker 轻松 详细
- SpringCloud|Spring Cloud Stream 使用延迟消息实现定时任务(RabbitMQ)
- tshark 抓包 rabbitmq 协议包
- 服务端_java|SpringCloud极简入门>消息总线#bus
- activeMQ的源码分析 -TCP通讯机制