public void SetUp()
        {
            this.context = new Context();

            this.registry = new HandlerRegistrySimulator(this.context);

            this.sender = new MessageUnit(new EndpointConfiguration().Endpoint(SenderEndpointName).Concurrency(1))
                          .Use(MessagingFactory.Create())
                          .Use(new AlwaysRouteToDestination(Queue.Create(ReceiverEndpointName)))
                          .Use(this.registry);

            this.receiver = new MessageUnit(new EndpointConfiguration().Endpoint(ReceiverEndpointName).Concurrency(1))
                            .Use(MessagingFactory.Create())
                            .Use(this.registry);

            this.SetUpNecessaryInfrastructure();

            this.sender.StartAsync().Wait();
            this.receiver.StartAsync().Wait();
        }
        public void SetUp()
        {
            this.context = new Context();

            this.registry = new HandlerRegistrySimulator(this.context);

            this.broker = new Broker();
            this.sender = new MessageUnit(new EndpointConfiguration().Endpoint(SenderEndpointName).Concurrency(1))
                          .Use(new AlwaysRouteToDestination(Queue.Create(ReceiverEndpointName)))
                          .Use(this.registry);

            this.receiver = new MessageUnit(new EndpointConfiguration().Endpoint(ReceiverEndpointName).Concurrency(1))
                            .Use(new AlwaysRouteToDestination(Queue.Create(SenderEndpointName)))
                            .Use(this.registry);

            this.broker.Register(this.sender)
            .Register(this.receiver);

            this.broker.Start();
        }
예제 #3
0
        public void SetUp()
        {
            this.context  = new Context();
            this.registry = new HandlerRegistrySimulator(this.context);
            this.router   = new Router();

            this.broker = new Broker();
            this.sender = new MessageUnit(new EndpointConfiguration().Endpoint("Sender").Concurrency(1))
                          .Use(this.router);
            this.receiverOne = new MessageUnit(new EndpointConfiguration().Endpoint(ReceiverOneEndpointName)
                                               .Concurrency(1)).Use(this.registry);
            this.receiverTwo = new MessageUnit(new EndpointConfiguration().Endpoint(ReceiverTwoEndpointName)
                                               .Concurrency(1)).Use(this.registry);
            this.receiverThree = new MessageUnit(new EndpointConfiguration().Endpoint(ReceiverThreeEndpointName)
                                                 .Concurrency(1)).Use(this.registry);

            this.broker.Register(this.sender)
            .Register(this.receiverOne)
            .Register(this.receiverTwo)
            .Register(this.receiverThree);

            this.broker.Start();
        }