예제 #1
0
        public Task Send(RabbitMqSendContext <T> context, IPipe <RabbitMqSendContext <T> > next)
        {
            var routingKey = _routingKeyFormatter.FormatRoutingKey(context);

            context.RoutingKey = routingKey;

            return(next.Send(context));
        }
예제 #2
0
        public static void SetTransportHeader(this RabbitMqSendContext context, string key, object value)
        {
            if (context.BasicProperties.Headers == null)
            {
                context.BasicProperties.Headers = new Dictionary <string, object>();
            }

            SetHeader(context.BasicProperties, key, value);
        }
예제 #3
0
 public string FormatRoutingKey(RabbitMqSendContext <TMessage> context)
 {
     return(_formatter(context) ?? "");
 }
 string IRoutingKeyFormatter.FormatRoutingKey <T>(RabbitMqSendContext <T> context)
 {
     return(context.RoutingKey);
 }
예제 #5
0
 public static void SetTransportHeader(this RabbitMqSendContext context, string key, object value)
 {
     SetHeader(context.BasicProperties, key, value);
 }