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); }
void SetViaPartitionKeyToIncomingBrokeredMessagePartitionKey(BrokeredMessage brokeredMessage, RoutingOptions routingOptions) { if (routingOptions.SendVia && routingOptions.ViaPartitionKey != null) { brokeredMessage.ViaPartitionKey = routingOptions.ViaPartitionKey; } }
public IEnumerable <BrokeredMessage> Convert(IEnumerable <BatchedOperation> outgoingMessages, RoutingOptions routingOptions) { return(outgoingMessages.Select(x => Convert(x, routingOptions))); }