public void Setup() { if (_endpointFactoryConfigurator != null) { IConfigurationResult result = ConfigurationResult.CompileResults(_endpointFactoryConfigurator.Validate()); try { EndpointFactory = _endpointFactoryConfigurator.CreateEndpointFactory(); // _endpointFactoryConfigurator = null; _endpointCache = new EndpointCache(EndpointFactory); EndpointCache = new EndpointCacheProxy(_endpointCache); } catch (Exception ex) { throw new ConfigurationException(result, "An exception was thrown during endpoint cache creation", ex); } } ServiceBusFactory.ConfigureDefaultSettings(x => { x.SetEndpointCache(EndpointCache); x.SetConcurrentConsumerLimit(4); x.SetReceiveTimeout(50.Milliseconds()); x.EnableAutoStart(); x.DisablePerformanceCounters(); }); EstablishContext(); }
public IServiceBusEnvironment GetCurrentEnvironment() { ConfigurationResult.CompileResults(Validate()); string environment = _currentEnvironment.ToLowerInvariant(); if (_environments.ContainsKey(environment)) { return(_environments[environment]()); } return(null); }
protected IEndpointFactory BuildEndpointFactory() { IConfigurationResult result = ConfigurationResult.CompileResults(_endpointFactoryConfigurator.Validate()); IEndpointFactory endpointFactory; try { endpointFactory = _endpointFactoryConfigurator.CreateEndpointFactory(); } catch (Exception ex) { throw new ConfigurationException(result, "An exception was thrown during endpoint cache creation", ex); } return(endpointFactory); }
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); } }
public static EndpointCache New([NotNull] Action <IEndpointFactoryConfigurator> configure) { Guard.AgainstNull(configure, "configure"); var configurator = new EndpointFactoryConfigurator(_defaultSettings); configure(configurator); IConfigurationResult result = ConfigurationResult.CompileResults(configurator.Validate()); try { IEndpointFactory endpointFactory = configurator.CreateEndpointFactory(); var endpointCache = new EndpointCache(endpointFactory); return(endpointCache); } catch (Exception ex) { throw new ConfigurationException(result, "An exception was thrown during endpoint cache creation", ex); } }