栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

回顾RabbitMQ声明队列的参数

回顾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:扩展参数。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/774318.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号