Ejemplo n.º 1
0
 public Task Send(object message, SendOptions options = null)
 {
     return this.unit.Send(message, options);
 }
Ejemplo n.º 2
0
        private Task Send(object message, SendOptions options, TransportMessage incoming)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message", "You cannot send null");
            }

            var sendOptions = options ?? new SendOptions();
            LogicalMessage msg = this.factory.Create(message, sendOptions.Headers);

            return this.SendMessage(msg, sendOptions, incoming);
        }
Ejemplo n.º 3
0
 private Task SendLocal(object message, SendOptions sendOptions, TransportMessage incoming)
 {
     sendOptions.Queue = this.readOnlyConfiguration.EndpointQueue;
     return this.Send(message, sendOptions, incoming);
 }
Ejemplo n.º 4
0
 public Task Send(object message, SendOptions options = null)
 {
     return this.Send(message, options, incoming: null);
 }
Ejemplo n.º 5
0
 private static void AddCustomHeaders(SendOptions sendOptions, TransportMessage incoming)
 {
     foreach (var keyvalue in incoming.Headers)
     {
         if (!HeaderKeys.IsKey(keyvalue.Key))
         {
             sendOptions.Headers.Add(keyvalue.Key, keyvalue.Value);
         }
     }
 }
Ejemplo n.º 6
0
 private static SendOptions CreatePostponeSendOptions(DateTime scheduledEnqueueTimeUtc, TransportMessage incoming)
 {
     var options = new SendOptions
                   {
                       CorrelationId = incoming.CorrelationId,
                       ScheduledEnqueueTimeUtc = scheduledEnqueueTimeUtc,
                       ReplyToAddress = incoming.ReplyTo
                   };
     AddCustomHeaders(options, incoming);
     return options;
 }