public static void SetUsingMessageEnvelope(this IReceiveContext context, MessageEnvelopeBase envelope)
		{
			context.SetSourceAddress(envelope.SourceAddress.ToUriOrNull());
			context.SetDestinationAddress(envelope.DestinationAddress.ToUriOrNull());
			context.SetResponseAddress(envelope.ResponseAddress.ToUriOrNull());
			context.SetFaultAddress(envelope.FaultAddress.ToUriOrNull());
			context.SetNetwork(envelope.Network);
			context.SetRetryCount(envelope.RetryCount);
			context.SetMessageType(envelope.MessageType);
			if (envelope.ExpirationTime.HasValue)
				context.SetExpirationTime(envelope.ExpirationTime.Value);
		}
Пример #2
0
 public static void CopyFrom(this MessageEnvelopeBase envelope, IMessageHeaders headers)
 {
     envelope.SourceAddress      = headers.SourceAddress.ToStringOrNull() ?? envelope.SourceAddress;
     envelope.DestinationAddress = headers.DestinationAddress.ToStringOrNull() ?? envelope.DestinationAddress;
     envelope.ResponseAddress    = headers.ResponseAddress.ToStringOrNull() ?? envelope.ResponseAddress;
     envelope.FaultAddress       = headers.FaultAddress.ToStringOrNull() ?? envelope.FaultAddress;
     envelope.RetryCount         = headers.RetryCount;
     envelope.MessageType        = headers.MessageType ?? envelope.MessageType;
     if (headers.ExpirationTime.HasValue)
     {
         envelope.ExpirationTime = headers.ExpirationTime.Value;
     }
 }
Пример #3
0
 public static Action <ISetInboundMessageHeaders> GetMessageHeadersSetAction(this MessageEnvelopeBase envelope)
 {
     return(headers =>
     {
         headers.Reset();
         headers.SetSourceAddress(envelope.SourceAddress);
         headers.SetDestinationAddress(envelope.DestinationAddress);
         headers.SetResponseAddress(envelope.ResponseAddress);
         headers.SetFaultAddress(envelope.FaultAddress);
         headers.SetRetryCount(envelope.RetryCount);
         headers.SetMessageType(envelope.MessageType);
         if (envelope.ExpirationTime.HasValue)
         {
             headers.SetExpirationTime(envelope.ExpirationTime.Value);
         }
     });
 }