public MessageProducer Send(string exchange, string routingKey, byte[] binaryMessage, MessageParameters messageParameters) { this._brokerChannel.Channel.BasicPublish(exchange, routingKey, messageParameters.Properties, binaryMessage); return this; }
public MessageProducer Send(string exchange, string routingKey, string textMessage, MessageParameters messageParameters) { this._brokerChannel.Channel.BasicPublish(exchange, routingKey, messageParameters.Properties, Encoding.UTF8.GetBytes(textMessage)); return this; }
public MessageProducer Send(byte[] binaryMessage, MessageParameters messageParameters) { this._brokerChannel.Channel.BasicPublish(this._brokerChannel.ExchangeName, this._brokerChannel.QueueName, messageParameters.Properties, binaryMessage); return this; }
public MessageProducer Send(string textMessage, MessageParameters messageParameters) { this._brokerChannel.Channel.BasicPublish(this._brokerChannel.ExchangeName, this._brokerChannel.QueueName, messageParameters.Properties, Encoding.UTF8.GetBytes(textMessage)); return this; }
private void Check(MessageParameters messageParameters) { if(this._brokerChannel.Durable) { if(!messageParameters.Durable) { throw new ArgumentException("MessageParameters must be durable."); } } else { if(messageParameters.Durable) { throw new ArgumentException("MessageParameters must not be durable."); } } }