using System.Collections.Generic; using RabbitMQ.Client; namespace Pole.EventBus.RabbitMQ { public class RabbitOptions { public string UserName { get; set; } public string Password { get; set; } public string VirtualHost { get; set; } public int MasChannelsPerConnection { get; set; } = 200; /// /// 目前为一个连接 当消息数量非常大时,单个TCP连接的运输能力有限,可以修改这个最大连接数提高运输能力 /// public int MaxConnection { get; set; } = 10; /// /// 消费者批量处理每次处理的最大消息量 /// public ushort CunsumerMaxBatchSize { get; set; } = 300; /// /// 消费者批量处理每次处理的最大延时 /// public int CunsumerMaxMillisecondsInterval { get; set; } = 1000; /// /// 消费者批量处理每次处理的最大延时 /// public int ProducerConfirmWaitTimeoutSeconds { get; set; } = 5; /// /// exchange 和 queue 名称的前缀 /// public string Prefix = "Pole_"; public string[] Hosts { get; set; } public List EndPoints { get { var list = new List(); foreach (var host in Hosts) { list.Add(AmqpTcpEndpoint.Parse(host)); } return list; } } } }