zoukankan      html  css  js  c++  java
  • QUEUEDECLARE方法和参数

    1:queue
    1)、QueueDeclare 声明队列
    QueueDeclareOk QueueDeclare(string queue, bool durable, bool exclusive, bool autoDelete, IDictionary<string, object> arguments);

    durable:持久化
    mnesia:数据库【有专门的表去保存我们的队列声明】
    exclusive:排外
    i:当前定义的队列是connection中的chanenl是共享的,其他的connection是访问不到的;
    ii:当connection.close时,queue就被删除。
    autoDelete:自动删除:当最后一个consumer断开之后,autodelete被触发;

    arguments:参数【功能强大】,rabbitmq的一个扩展
    2)、QueueBindNoWait 队列声明无需等待【async】异步流程


    3)、QueueDeclarePassive 消极的队列声明
    this.QueueDeclare(queue,true,false,false,false,null);
    only check if it exists

    如果队列不存在抛出异常
    如果队列存在不做任何操作

    4)、queue的arguments
    i)我们要知道的参数属性
    《1》、Message TTL
    queue TTL 限制队列中所有message限定一个时间
    x-message-ttl number类型
    Message TTL 单独指定message限定一个时间
    var properties=channel.CreateBasicProperties();
    properties.Exporation="8000";
    如果两个都设定,则按照时间短的触发。
    《2》、Auto Expire【自动删除】
    当queue在指定的时间未被访问 ,就会被删除
    consumer、basicget、declare。。。
    《3》、Max Length限定队列的最大长度 limit 100
    《4》、Max Length Bytes限定队列的最大占用空间大小 【一般来说受限于内存,disk的大小限定】

  • 相关阅读:
    管理者的四种不同授权风格
    centos7 未启用swap导致内存使用率过高。
    Dynamically create a div element with JavaScript/jQuery
    sql server: Parent/Child hierarchy tree view
    视频编解码系列(一)压缩编码基础常识
    mac 常用终端命令
    Linux下安装Python3.6.8
    SQL特殊字符转义
    Ehcache缓存监控
    指标管理体系设计
  • 原文地址:https://www.cnblogs.com/sailing92/p/13710266.html
Copyright © 2011-2022 走看看