public ProcessingServiceTests() { LogManager.OutputToTrace(); _storage = Substitute.For<IStoreUnhandledMessages>(); _processor = Substitute.For<IProcessMessage>(); _errors = Substitute.For<IFailedMessagesQueue>(); _sut =new ProcessingService(_storage,()=>_processor,new BusAuditor(new InMemoryAuditStorage()), _errors); _sut.PollingEnabled = false; _sut.Start(); }
internal EndpointConfig[] Build(ConfigureHost host, IContainerScope container, BusAuditor auditor) => _points.Select(ec => { var ep = ec.Key; var nexus = new MessageHandlersNexus(container,auditor,host); nexus.Add(host.Handlers.Where(ep.CanHandle).ToArray()); var processor = new ProcessingService(host.GetStorage<IStoreUnhandledMessages>(), () => new MessageProcessor(nexus), auditor,host.GetStorage<IFailedMessagesQueue>()); ec.Value(processor); var config = new EndpointConfig(processor); config.Id = new EndpointId(ep.Name, host.HostName); config.HandledMessagesTypes = nexus.GetMessageTypes().ToArray(); processor.Name = config.Id; return config; }).ToArray();
public EndpointConfig(ProcessingService queue) { _queue = queue; }