Example #1
0
        internal BrokeredMessage Convert(BatchedOperationInternal outgoingOperation, RoutingOptionsInternal routingOptions)
        {
            var outgoingMessage = outgoingOperation.Message;
            var brokeredMessage = CreateBrokeredMessage(outgoingMessage);

            brokeredMessage.MessageId = Guid.NewGuid().ToString();

            ApplyDeliveryConstraints(brokeredMessage, outgoingOperation);

            ApplyCorrelationId(outgoingMessage, brokeredMessage);

            SetReplyToAddress(outgoingMessage, brokeredMessage, routingOptions.DestinationNamespace);

            SetViaPartitionKeyToIncomingBrokeredMessagePartitionKey(brokeredMessage, routingOptions);

            SetEstimatedMessageSizeHeader(brokeredMessage, outgoingOperation.GetEstimatedSize());

            CopyHeaders(outgoingMessage, brokeredMessage);

            return(brokeredMessage);
        }
Example #2
0
 void SetViaPartitionKeyToIncomingBrokeredMessagePartitionKey(BrokeredMessage brokeredMessage, RoutingOptionsInternal routingOptions)
 {
     if (routingOptions.SendVia && routingOptions.ViaPartitionKey != null)
     {
         brokeredMessage.ViaPartitionKey = routingOptions.ViaPartitionKey;
     }
 }
Example #3
0
 public IEnumerable <BrokeredMessage> Convert(IEnumerable <BatchedOperationInternal> outgoingMessages, RoutingOptionsInternal routingOptions)
 {
     return(outgoingMessages.Select(x => Convert(x, routingOptions)));
 }