Пример #1
0
        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();
Пример #2
0
        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 relayer   = new RelayLocalEvents(host.Relayer);
            var processor = new ProcessingService(host.GetStorage <IStoreUnhandledMessages>(), () => new MessageProcessor(nexus, relayer), 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();