回顾RabbitMQ声明队列的参数

一 引入的POM依赖

		<dependency>
			<groupId>com.rabbitmq</groupId>
			<artifactId>amqp-client</artifactId>
			<version>3.6.5</version>
		</dependency>

二 声明队列的源码

package com.rabbitmq.client;

public interface Channel extends ShutdownNotifier {

    //声明队列
    Queue.DeclareOk queueDeclare(String queue, boolean durable, boolean exclusive, boolean autoDelete,Map<String, Object> 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:扩展参数。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值