Esempio n. 1
0
 public IncommingMessageContextTest()
 {
     this.headers = new Dictionary <string, object> {
         { HeaderKeys.Sender, new EndpointAddress("sender") }
     };
     this.pipelineConfiguration = A.Fake <IHavePipelineConfiguration>();
 }
 /// <summary>
 /// Creates a new instance of <see cref="IncommingMessageContext"/>
 /// </summary>
 /// <param name="message">The incomming message</param>
 /// <param name="headers">The original envelope headers</param>
 /// <param name="configuration">Dependency injection for <see cref="IHavePipelineConfiguration"/></param>
 public IncommingMessageContext(
     IMessage message,
     IDictionary <string, object> headers,
     IHavePipelineConfiguration configuration) : base(configuration)
 {
     this.Message = message;
     this.Headers = headers;
 }
Esempio n. 3
0
 /// <summary>
 /// Creates a new instance of <see cref="IncommingPipeline"/>
 /// </summary>
 /// <param name="configuration">Dependency injection for <see cref="IHavePipelineConfiguration"/></param>
 /// <param name="incommingEnvelopeSteps">All registered pipeline steps for incomming envelopes</param>
 /// <param name="incommingMessageSteps">All registered pipeline steps for incomming messages</param>
 public IncommingPipeline(
     IHavePipelineConfiguration configuration,
     IEnumerable <IncommingEnvelopeStep> incommingEnvelopeSteps,
     IEnumerable <IncommingMessageStep> incommingMessageSteps)
 {
     this.configuration          = configuration;
     this.incommingEnvelopeSteps = new Queue <IncommingEnvelopeStep>(incommingEnvelopeSteps);
     this.incommingMessageSteps  = new Queue <IncommingMessageStep>(incommingMessageSteps);
 }
Esempio n. 4
0
        private static void CreateSubscriptionMessageEnvelope(
            SubscriptionMessage subscriptionMessage,
            IHavePipelineConfiguration configuration,
            Action <EndpointAddress> createEnvelope)
        {
            var endpointAddress = configuration.GetPublishingEndpointAddress(subscriptionMessage.MessageType);

            createEnvelope(endpointAddress);
        }
Esempio n. 5
0
        private static void CreateCommandEnvelope(
            ICommand command,
            IHavePipelineConfiguration configuration,
            Action <EndpointAddress> createEnvelope)
        {
            var endpointAddress = configuration.GetConsumingEndpointAddress(command);

            createEnvelope(endpointAddress);
        }
Esempio n. 6
0
 /// <summary>
 /// Creates a new instance of <see cref="OutgoingPipeline"/>
 /// </summary>
 /// <param name="configuration">Dependency injection for <see cref="IHavePipelineConfiguration"/></param>
 /// <param name="outgoingMessageSteps">All registered pipeline steps for outgoing messages</param>
 /// <param name="outgoingEnvelopeSteps">All registered pipeline steps for outgoing envelopes</param>
 public OutgoingPipeline(
     IHavePipelineConfiguration configuration,
     IEnumerable <OutgoingMessageStep> outgoingMessageSteps,
     IEnumerable <OutgoingEnvelopeStep> outgoingEnvelopeSteps)
 {
     this.configuration         = configuration;
     this.outgoingMessageSteps  = new Queue <OutgoingMessageStep>(outgoingMessageSteps);
     this.outgoingEnvelopeSteps = new Queue <OutgoingEnvelopeStep>(outgoingEnvelopeSteps);
 }
Esempio n. 7
0
 private static void CreateEventEnvelopes(
     IEvent @event,
     IHavePipelineConfiguration configuration,
     Action <EndpointAddress> createEnvelope)
 {
     foreach (var endpointAddress in configuration.GetSubscribedEndpointAddresses(@event))
     {
         createEnvelope(endpointAddress);
     }
 }
        public OutgoingPipelineTest()
        {
            this.configuration = A.Fake <IHavePipelineConfiguration>();
            this.messageStep   = new FakeMessageStep();
            this.envelopeStep  = new FakeEnvelopeStep();

            var outgoingMessageSteps = new List <OutgoingMessageStep> {
                this.messageStep
            };
            var outgoingEnvelopeSteps = new List <OutgoingEnvelopeStep> {
                this.envelopeStep
            };

            this.testee = new OutgoingPipeline(this.configuration, outgoingMessageSteps, outgoingEnvelopeSteps);
        }
 /// <summary>
 /// Creates a new instance of <see cref="OutgoingMessageContext"/>
 /// </summary>
 /// <param name="message">The outgoing message</param>
 /// <param name="configuration">Dependency injection for <see cref="IHavePipelineConfiguration"/></param>
 public OutgoingMessageContext(IMessage message, IHavePipelineConfiguration configuration)
     : base(configuration)
 {
     this.envelopes = new List <Envelope>();
     this.Message   = message;
 }
Esempio n. 10
0
 /// <summary>
 /// Creates a new instance of <see cref="OutgoingEnvelopeContext"/>
 /// </summary>
 /// <param name="envelope">The outgoing envelope</param>
 /// <param name="configuration">Dependency injection for <see cref="IHavePipelineConfiguration"/></param>
 public OutgoingEnvelopeContext(Envelope envelope, IHavePipelineConfiguration configuration)
     : base(configuration)
 {
     this.Envelope = envelope;
 }
Esempio n. 11
0
 /// <summary>
 /// Creates a new instance of <see cref="PipelineContext"/>
 /// </summary>
 /// <param name="configuration">Dependency injection for <see cref="IHavePipelineConfiguration"/></param>
 protected PipelineContext(IHavePipelineConfiguration configuration)
 {
     this.Configuration = configuration;
 }