/********************************
*
* 作者:吴隆健
* 创建时间: 2019/6/24 13:47:34
*
********************************/
#if RABBITMQ
using System;
namespace MrWu.RabbitMQ {
///
/// Rabbit配置
///
public class RabbitConfig {
///
/// 用户名
///
public string username;
///
/// 密码
///
public string password;
///
/// 虚拟主机
///
public string vhost;
///
/// ip
///
public string host = "127.0.0.1";
///
/// 端口
///
public int port = 5672;
///
/// 交换机
///
public ExchangeInfo[] exchanges;
///
/// 队列
///
public QueueInfo[] queues;
///
/// 绑定信息
///
public BindInfo[] binds;
///
/// 是否异步确认模式
///
public bool AsynConfirm = true;
///
/// 构造器
///
public RabbitConfig() { }
}
///
/// 交换机
///
public class ExchangeInfo {
///
/// 交换机名称
///
public string name = string.Empty;
///
/// 类型
///
public string type = "direct";
///
/// 持久化
///
public bool durable = true;
///
/// 自动删除
///
public bool autodelete = false;
///
/// 备用交换机 当消息无法路由是,投递到的备用交换机
///
public string alternate_exchange = null;
///
/// 如果存在则先删除再声明
///
public bool delExists = false;
///
/// 构造器
///
public ExchangeInfo() { }
}
///
/// 队列信息
///
public class QueueInfo {
///
/// 队列名称
///
public string name;
///
/// 持久化
///
public bool durable = false;
///
/// 独占
///
public bool exclusive = false;
///
/// 自动删除
///
public bool autodelete = false;
///
/// 启动时清空队列
///
public bool startClear = false;
///
/// 如果存在则先删除
///
public bool delExists = false;
///
/// 消息过期时间
///
public int x_message_ttl = 0;
///
/// 在指定的时间内没有消费者链接就会删除队列
///
public int x_expires = 0;
///
/// 消最大就绪的条目数
///
public int x_max_length = 0;
///
/// 消息最大的就绪内容大小
///
public int x_max_length_bytes = 0;
///
/// 当消息溢出时,删除头部消息(drop-head)/拒绝消息(reject-publish)
///
public string x_overflow = null;
///
/// 当消息被丢弃时,丢弃到哪个交换机中 与 x-dead-touting-key 一起使用
///
public string x_dead_letter_exchange = null;
///
/// 当消息被丢弃时,投递到交换机中使用的路由键
///
public string x_dead_routing_key = null;
///
/// 队列 优先级
///
public int x_max_priority = 0;
///
/// 队列模式 default / lazy . lazy 表示消息存储在磁盘中,当消费者需要的时候才加载到内存中,当消息大量积累的情况应该启用
///
public string x_queue_mode = null;
}
///
/// 绑定信息
///
public class BindInfo {
///
/// 绑定类型 queue / exchange
///
public string bindType = "queue";
///
/// 目标
///
public string destination;
///
/// 源
///
public string source;
///
/// 路由键
///
public string routingkey;
}
}
#endif