Ejemplo n.º 1
0
 private static void CreateRequestMessagePumps(BusBuilderConfiguration configuration, MessagingFactory messagingFactory, List<IMessagePump> messagePumps)
 {
     foreach (var requestType in configuration.RequestTypes)
     {
         var pump = new RequestMessagePump(messagingFactory, configuration.RequestBroker, requestType, configuration.Logger);
         messagePumps.Add(pump);
     }
 }
Ejemplo n.º 2
0
        private static void CreateRequestMessagePumps(BusBuilderConfiguration configuration, MessagingFactory messagingFactory, List<IMessagePump> messagePumps, ILogger logger)
        {
            logger.Debug("Creating request message pumps");


            var requestTypes = configuration.RequestHandlerTypes.SelectMany(ht => ht.GetGenericInterfacesClosing(typeof(IHandleRequest<,>)))
                                            .Select(gi => gi.GetGenericArguments().First())
                                            .OrderBy(t => t.FullName)
                                            .Distinct()
                                            .ToArray();

            foreach (var requestType in requestTypes)
            {
                logger.Debug("Registering Message Pump for Request type {0}", requestType.Name);
                var pump = new RequestMessagePump(messagingFactory, configuration.RequestBroker, requestType, configuration.Logger, configuration.DefaultBatchSize);
                messagePumps.Add(pump);
            }

  
        }