public void Setup() { if (_endpointFactoryConfigurator != null) { ConfigurationResult result = ConfigurationResultImpl.CompileResults(_endpointFactoryConfigurator.Validate()); try { EndpointFactory = _endpointFactoryConfigurator.CreateEndpointFactory(); _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(TimeSpan.FromMilliseconds(50)); x.EnableAutoStart(); x.DisablePerformanceCounters(); }); EstablishContext(); }
public void ActivityTestFixtureFixtureTeardown() { foreach (ActivityTestContext activityTestContext in ActivityTestContexts.Values) { activityTestContext.Dispose(); } LocalBus.Dispose(); if (_cancellationTokenSource != null) { _cancellationTokenSource.Dispose(); } if (_timer != null) { _timer.Dispose(); } _endpointCache.Clear(); if (EndpointCache != null) { EndpointCache.Dispose(); EndpointCache = null; } ServiceBusFactory.ConfigureDefaultSettings(x => { x.SetEndpointCache(null); }); }
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(150.Milliseconds()); x.EnableAutoStart(); }); }
public void FixtureTeardown() { if (EndpointCache != null) { EndpointCache.Dispose(); EndpointCache = null; } ServiceBusFactory.ConfigureDefaultSettings(x => x.SetEndpointCache(null)); }
public void FixtureTeardown() { TeardownBuses(); if (EndpointCache != null) { _endpointCache.Dispose(); _endpointCache = null; EndpointCache = null; } ServiceBusFactory.ConfigureDefaultSettings(x => { x.SetEndpointCache(null); }); }
public void ActivityTextFixtureSetup() { if (_endpointFactoryConfigurator != null) { ConfigurationResult result = ConfigurationResultImpl.CompileResults(_endpointFactoryConfigurator.Validate()); try { EndpointFactory = _endpointFactoryConfigurator.CreateEndpointFactory(); _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(); }); LocalUri = new Uri(BaseUri, "local"); AddCommandContext <DispatchMessageConsumer, DispatchMessage>(() => { var agent = new MessageDispatchAgent(LocalBus); return(new DispatchMessageConsumer(agent)); }); SetupCommands(); LocalBus = CreateServiceBus(ConfigureLocalBus); DispatchEndpoint = LocalBus.GetEndpoint(GetActivityContext <DispatchMessage>().ExecuteUri); }
public void ActivityTextFixtureSetup() { if (_endpointFactoryConfigurator != null) { ConfigurationResult result = ConfigurationResultImpl.CompileResults(_endpointFactoryConfigurator.Validate()); try { EndpointFactory = _endpointFactoryConfigurator.CreateEndpointFactory(); _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(); }); LocalUri = new Uri(BaseUri, "local"); SetupActivities(); LocalBus = CreateServiceBus(ConfigureLocalBus); }
protected EndpointTestScenarioImpl(IEndpointFactory endpointFactory) { _received = new ReceivedMessageListImpl(); _sent = new SentMessageListImpl(); _skipped = new ReceivedMessageListImpl(); _published = new PublishedMessageListImpl(); _endpoints = new Dictionary <Uri, EndpointTestDecorator>(); EndpointFactory = new EndpointFactoryTestDecorator(endpointFactory, this); _endpointCache = new EndpointCache(EndpointFactory); EndpointCache = new EndpointCacheProxy(_endpointCache); ServiceBusFactory.ConfigureDefaultSettings(x => { x.SetEndpointCache(EndpointCache); x.SetConcurrentConsumerLimit(4); x.SetConcurrentReceiverLimit(1); x.SetReceiveTimeout(50.Milliseconds()); x.EnableAutoStart(); }); }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { _sent.Dispose(); _received.Dispose(); _endpointCache.Clear(); if (EndpointCache != null) { EndpointCache.Dispose(); EndpointCache = null; } ServiceBusFactory.ConfigureDefaultSettings(x => x.SetEndpointCache(null)); } _disposed = true; }