コード例 #1
0
ファイル: Consumer.cs プロジェクト: stonezhu870/never
        /// <summary>
        /// Initializes a new instance of the <see cref="Consumer"/> class.
        /// </summary>
        /// <param name="connection">The connection.</param>
        /// <param name="formater">The formater.</param>
        /// <exception cref="Never.Exceptions.MessageException">配置MQ路由不能为空</exception>
        public Consumer(MessageConnection connection, IMessageFormatter formater)
        {
            this.connection = connection;
            if (connection == null || string.IsNullOrEmpty(connection.ConnetctionString))
            {
                throw new ArgumentNullException("配置MQ路由不能为空");
            }

            this.queue = new MessageQueue()
            {
                Formatter = formater ?? new BinaryMessageFormatter(),
                Path      = connection.ConnetctionString
            };
            this.queue.MessageReadPropertyFilter.Priority = true;
        }
コード例 #2
0
ファイル: Consumer.cs プロジェクト: stonezhu870/never
 /// <summary>
 /// Initializes a new instance of the <see cref="Consumer"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 public Consumer(MessageConnection connection)
     : this(connection, new BinaryMessageFormatter())
 {
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Producer"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 public Producer(MessageConnection connection)
     : this(connection, new BinaryMessageFormatter())
 {
 }