Exemple #1
0
 private static void CreateCommandMessagePumps(BusBuilderConfiguration configuration, MessagingFactory messagingFactory, List<IMessagePump> messagePumps)
 {
     foreach (var commandType in configuration.CommandTypes)
     {
         var pump = new CommandMessagePump(messagingFactory, configuration.CommandBroker, commandType, configuration.Logger);
         messagePumps.Add(pump);
     }
 }
Exemple #2
0
        private static void CreateCommandMessagePumps(BusBuilderConfiguration configuration, MessagingFactory messagingFactory, List<IMessagePump> messagePumps, ILogger logger)
        {
            logger.Debug("Creating command message pumps");

            var commandTypes = configuration.CommandHandlerTypes.SelectMany(ht => ht.GetGenericInterfacesClosing(typeof(IHandleCommand<>)))
                                .Select(gi => gi.GetGenericArguments().First())
                                .OrderBy(t => t.FullName)
                                .Distinct()
                                .ToArray();

            foreach (var commandType in commandTypes)
            {
                logger.Debug("Registering Message Pump for Command type {0}", commandType.Name);
                var pump = new CommandMessagePump(messagingFactory, configuration.CommandBroker, commandType, configuration.Logger, configuration.DefaultBatchSize);
                messagePumps.Add(pump);    
            }

        }