示例#1
0
        protected virtual IChannelTransaction Dispatch(params Uri[] targets)
        {
            this.ThrowWhenDispatched();
            this.ThrowWhenNoMessages();

            var message = this.builder.Build(
                this.correlationIdentifier, this.returnAddress, this.messageHeaders, this.logicalMessages);
            var envelope = new ChannelEnvelope(message, targets, this.applicationState ?? this.channel.CurrentMessage);

            Log.Verbose("Dispatching message '{0}' with correlation identifier '{1}' to {2} recipient(s).",
                        message.MessageId, message.CorrelationId, targets.Length);

            this.Dispatch(envelope);

            this.dispatched   = true;
            this.MessageCount = 0;
            this.HeaderCount  = 0;

            return(this.channel.CurrentTransaction);
        }
		protected virtual void Dispatch(ChannelEnvelope envelope)
		{
			this.channel.Send(envelope);
		}
		protected virtual IChannelTransaction Dispatch(params Uri[] targets)
		{
			this.ThrowWhenDispatched();
			this.ThrowWhenNoMessages();

			var message = this.builder.Build(
				this.correlationIdentifier, this.returnAddress, this.messageHeaders, this.logicalMessages);
			var envelope = new ChannelEnvelope(message, targets, this.applicationState ?? this.channel.CurrentMessage);

			Log.Verbose("Dispatching message '{0}' with correlation identifier '{1}' to {2} recipient(s).",
				message.MessageId, message.CorrelationId, targets.Length);

			this.Dispatch(envelope);

			this.dispatched = true;
			this.MessageCount = 0;
			this.HeaderCount = 0;

			return this.channel.CurrentTransaction;
		}
 internal static Guid MessageId(this ChannelEnvelope envelope)
 {
     return(envelope == null || envelope.Message == null ? Guid.Empty : envelope.Message.MessageId);
 }
示例#5
0
 protected virtual void Dispatch(ChannelEnvelope envelope)
 {
     this.channel.Send(envelope);
 }