Пример #1
0
        public ReplicationFixture()
            : base(new XmlInterpreter("Primary.config"))
        {
            secondary = new WindsorContainer(new XmlInterpreter("Secondary.config"));

            secondary.Kernel.AddFacility("rhino.esb", new RhinoServiceBusFacility());

            secondaryBootStrapper = new DhtBootStrapper();
            secondaryBootStrapper.InitializeContainer(secondary);

            secondaryBus = secondary.Resolve<IStartableServiceBus>();
            secondaryBus.Start();

            secondaryBootStrapper.AfterStart();

            tertiary = new WindsorContainer(new XmlInterpreter("Tertiary.config"));
            tertiary.Kernel.AddFacility("rhino.esb", new RhinoServiceBusFacility());

            tertiaryBootStrapper = new DhtBootStrapper();
            tertiaryBootStrapper.InitializeContainer(tertiary);

            tertiaryBus = tertiary.Resolve<IStartableServiceBus>();
            tertiaryBus.Start();

            tertiaryBootStrapper.AfterStart();

            buses = new[]
            {
                bus,
                secondaryBus,
                tertiaryBus,
            };

            bootStrappers = new[]
            {
                bootStrapper,
                secondaryBootStrapper,
                tertiaryBootStrapper,
            };
        }
Пример #2
0
        public DhtTestBase(IConfigurationInterpreter interpreter)
        {
            EnsureQueueExistsAndIsEmpty("msmq://localhost/dht_test.replication");
            EnsureQueueExistsAndIsEmpty("msmq://localhost/dht_test.replication2");
            EnsureQueueExistsAndIsEmpty("msmq://localhost/dht_test.replication3");

            Delete("cache.esent");
            Delete("cache1.esent");
            Delete("cache2.esent");
            Delete("cache3.esent");
            Delete("test.esent");

            container = new WindsorContainer(interpreter);
            var facility = new RhinoServiceBusFacility();
            bootStrapper = new DhtBootStrapper();
            bootStrapper.ConfigureBusFacility(facility);

            container.Kernel.AddFacility("rhino.esb", facility);

            bus = container.Resolve<IStartableServiceBus>();

            bootStrapper.InitializeContainer(container);

            bus.Start();

            bootStrapper.AfterStart();

            metaDataUrl = new Uri("net.tcp://localhost:8128/dht.metadata");
            client = new DistributedHashTableClient(new Node
            {
                Primary = new NodeUri
                {
                    Sync = metaDataUrl
                }
            });
        }