Exemple #1
0
        Task SendMessage(LogicalMessage outgoingLogicalMessage, DeliveryOptions options, TransportMessage incoming)
        {
            if (options.ReplyToAddress == null)
            {
                options.ReplyToAddress = configuration.EndpointQueue;
            }

            OutgoingPipeline outgoingPipeline = outgoingPipelineFactory.Create();

            return(outgoingPipeline.Invoke(outgoingLogicalMessage, options, readOnlyConfiguration, incoming));
        }
        public void Setup()
        {
            pipeline = new OutgoingPipeline(
                new[] { mockBehaviour.Object },
                mockSink.Object,
                NullLogger <OutgoingPipeline> .Instance);

            messages = new[]
            {
                new OutgoingMessage(Guid.NewGuid().ToString(), null, new[] { "test" })
            };
        }
        public SimpleJitneyTest()
        {
            Trace.Listeners.Add(InMemoryTraceListener.Instance);

            this.configuration    = A.Fake <IHaveJitneyConfiguration>();
            this.outgoingPipeline = A.Fake <OutgoingPipeline>();

            A.CallTo(() => this.configuration.LocalEndpointAddress).Returns(new EndpointAddress("myQueue", "localhost"));
            A.CallTo(() => this.configuration.CreateOutgoingPipeline(A <Func <Envelope, Task> > .Ignored))
            .Returns(this.outgoingPipeline);

            this.testee = new SimpleJitney(this.configuration);
        }
            public OutgoingPipeline Create()
            {
                var pipeline   = new OutgoingPipeline();
                var senderStep = new DispatchToTransportStep(new MessageSenderSimulator(this.onMessage), new MessagePublisherSimulator(this.onMessage));

                pipeline.Logical
                .Register(new CreateTransportMessageStep())
                .Register(new TraceOutgoingLogical(this.outgoing));

                pipeline.Transport
                .Register(new SerializeMessageStep(new NewtonsoftJsonMessageSerializer()))
                .Register(new DetermineDestinationStep(this.router))
                .Register(new EnrichTransportMessageWithDestinationAddress())
                .Register(senderStep);

                return(pipeline);
            }
        public MessageQueueJitneyTest()
        {
            Trace.Listeners.Add(InMemoryTraceListener.Instance);

            this.configuration        = A.Fake <IHaveJitneyConfiguration>();
            this.messageQueueProvider = A.Fake <IMessageQueueProvider>();
            this.outgoingPipeline     = A.Fake <OutgoingPipeline>();
            this.localEndpointAddress = new EndpointAddress("myQueue");

            A.CallTo(() => this.configuration.LocalEndpointAddress).Returns(this.localEndpointAddress);
            A.CallTo(() => this.configuration.Get <IMessageQueueProvider>(MessageQueueJitney.MessageQueueProvider))
            .Returns(this.messageQueueProvider);
            A.CallTo(() => this.configuration.CreateOutgoingPipeline(A <Func <Envelope, Task> > .Ignored))
            .Returns(this.outgoingPipeline);
            A.CallTo(() => this.messageQueueProvider.TransportMediumName).Returns("Foo");

            this.testee = new MessageQueueJitney(this.configuration);
        }
            public OutgoingPipeline Create()
            {
                var pipeline = new OutgoingPipeline();
                var senderStep = new DispatchToTransportStep(new MessageSenderSimulator(this.onMessage), new MessagePublisherSimulator(this.onMessage));

                pipeline.Logical
                    .Register(new CreateTransportMessageStep())
                    .Register(new TraceOutgoingLogical(this.outgoing));

                pipeline.Transport
                    .Register(new SerializeMessageStep(new NewtonsoftJsonMessageSerializer()))
                    .Register(new DetermineDestinationStep(this.router))
                    .Register(new EnrichTransportMessageWithDestinationAddress())
                    .Register(senderStep);

                return pipeline;
            }