/// <summary>
        /// 自定义配置和消息处理方式
        /// </summary>
        /// <param name="config"></param>
        /// <param name="handler"></param>
        public RabbitMQSubscriber(RabbitMqConfig config, IMQMsgHandler handler)
        {
            //自定义MQ配置
            this.rabbitMqService = new RabbitMqService(config);

            //自定义消息处理方式
            this.mqMsgHandler = handler;
        }
        /// <summary>
        /// 自定义配置
        /// </summary>
        /// <param name="config"></param>
        public RabbitMQSubscriber(RabbitMqConfig config)
        {
            //自定义MQ配置
            this.rabbitMqService = new RabbitMqService(config);

            //使用默认消息处理方式
            this.mqMsgHandler = new DefaultMQMsgHandler();
        }
Esempio n. 3
0
 /// <summary>
 /// 默认配置
 /// </summary>
 public RabbitMQPublisher()
 {
     this.rabbitMqService = new RabbitMqService(new RabbitMqConfig
     {
         AutomaticRecoveryEnabled = true,
         HeartBeat = 60,
         NetworkRecoveryInterval = new TimeSpan(60),
         Host     = "localhost",
         UserName = "******",
         Password = "******"
     });
 }
        /// <summary>
        /// 默认配置
        /// </summary>
        public RabbitMQSubscriber()
        {
            //默认MQ配置
            this.rabbitMqService = new RabbitMqService(new RabbitMqConfig
            {
                AutomaticRecoveryEnabled = true,
                HeartBeat = 60,
                NetworkRecoveryInterval = new TimeSpan(60),
                Host     = "localhost",
                UserName = "******",
                Password = "******"
            });

            //使用默认消息处理方式
            this.mqMsgHandler = new DefaultMQMsgHandler();
        }
Esempio n. 5
0
 /// <summary>
 /// 自定义配置
 /// </summary>
 /// <param name="config"></param>
 public RabbitMQPublisher(RabbitMqConfig config)
 {
     this.rabbitMqService = new RabbitMqService(config);
 }