protected virtual void BuildRemoteBus(LocalRemoteTestScenario scenario)
        {
            _remoteConfigurator.ChangeSettings(x => { x.EndpointCache = scenario.EndpointCache; });

            _remoteConfigurator.AddSubscriptionObserver((bus, coordinator) =>
            {
                _remoteLoopback = new SubscriptionLoopback(bus, coordinator);
                return(_remoteLoopback);
            });

            scenario.RemoteBus = _remoteConfigurator.CreateServiceBus();
        }
Exemplo n.º 2
0
        public override IBusTestScenario Build()
        {
            IEndpointFactory endpointFactory = BuildEndpointFactory();

            var scenario = new BusTestScenario(endpointFactory);

            _configurator.ChangeSettings(x => { x.EndpointCache = scenario.EndpointCache; });
            _configurator.EnableMessageTracing();

            scenario.Bus = _configurator.CreateServiceBus();

            return(scenario);
        }
Exemplo n.º 3
0
        public static IServiceBus New([NotNull] Action <IServiceBusConfigurator> configure)
        {
            Guard.AgainstNull(configure, "configure");

            var configurator = new ServiceBusConfigurator(_defaultSettings);

            //configurator.EnableMessageTracing();

            configure(configurator);

            var result = ConfigurationResult.CompileResults(configurator.Validate());

            try
            {
                return(configurator.CreateServiceBus());
            }
            catch (Exception ex)
            {
                throw new ConfigurationException(result, "An exception was thrown during service bus creation", ex);
            }
        }