/// <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; }
/// <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()) { }
/// <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()) { }