Exemplo n.º 1
0
        public UnsubscribeAction SubscribedTo <T>(Uri endpointUri)
            where T : class
        {
            if (endpointUri == _bus.Endpoint.Uri)
            {
                return(() => true);
            }

            IEndpoint endpoint = _endpointFactory.GetEndpoint(endpointUri);

            return(_pipeline.Subscribe <T>(endpoint));
        }
Exemplo n.º 2
0
        public void A_batch_component_should_be_delivered_messages()
        {
            var consumer = new TestBatchConsumer <IndividualBatchMessage, Guid>();

            _builder.Stub(x => x.GetInstance <TestBatchConsumer <IndividualBatchMessage, Guid> >()).Return(consumer);

            _pipeline.Subscribe <TestBatchConsumer <IndividualBatchMessage, Guid> >();
            PipelineViewer.Trace(_pipeline);

            PublishBatch(_pipeline, 1);

            TimeSpan _timeout = 5.Seconds();

            TestBatchConsumer <IndividualBatchMessage, Guid> .AnyShouldHaveReceivedBatch(_batchId, _timeout);
        }
 public UnsubscribeAction SubscribedTo <T>()
     where T : class
 {
     return(_outbound.Subscribe <T>(_localEndpoint));
 }