Esempio n. 1
0
 private void RabbitSendMessage(IModel channel, string message,
                                IBasicProperties props, string routingKey)
 {
     channel.BasicPublish(ExchangeName,
                          routingKey,
                          props,
                          props.GetEncoding().GetBytes(message));
 }
Esempio n. 2
0
 public static Dictionary <string, object> DecodeHeaders(this IBasicProperties basicProperties)
 {
     return(basicProperties.Headers.ToDictionary(s => s.Key,
                                                 s => s.Value == null
             ? null
             : s.Value.GetType() == typeof(byte[])
                 ? basicProperties.GetEncoding().GetString((byte[])s.Value)
                 : s.Value));
 }