Пример #1
0
        internal BrokeredMessage Convert(BatchedOperation outgoingOperation, RoutingOptions 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);
        }
Пример #2
0
 void SetViaPartitionKeyToIncomingBrokeredMessagePartitionKey(BrokeredMessage brokeredMessage, RoutingOptions routingOptions)
 {
     if (routingOptions.SendVia && routingOptions.ViaPartitionKey != null)
     {
         brokeredMessage.ViaPartitionKey = routingOptions.ViaPartitionKey;
     }
 }
Пример #3
0
 public IEnumerable <BrokeredMessage> Convert(IEnumerable <BatchedOperation> outgoingMessages, RoutingOptions routingOptions)
 {
     return(outgoingMessages.Select(x => Convert(x, routingOptions)));
 }