コード例 #1
0
 public MessageProducer Send(string exchange, string routingKey, byte[] binaryMessage,
     MessageParameters messageParameters)
 {
     this._brokerChannel.Channel.BasicPublish(exchange, routingKey, messageParameters.Properties,
         binaryMessage);
     return this;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 public MessageProducer Send(byte[] binaryMessage, MessageParameters messageParameters)
 {
     this._brokerChannel.Channel.BasicPublish(this._brokerChannel.ExchangeName, this._brokerChannel.QueueName,
         messageParameters.Properties, binaryMessage);
     return this;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 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.");
         }
     }
 }