Exemple #1
0
 public MessageHandlersNexus(IContainerScope container, BusAuditor auditor, ConfigureHost host)
 {
     container.MustNotBeNull();
     _container = container;
     _auditor   = auditor;
     _host      = host;
     _error     = host.GetStorage <IFailedMessagesQueue>();
 }
Exemple #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();