public InMemoryMessageListener(
         Type messageHandlerType,
         IMessageHandlerTypesIndexFactory messageHandlerTypesIndexFactory,
         IMessageHandlerInvokerFactory messageHandlerInvokerFactory,
         IConfiguration configuration,
         IMessageServiceExchange messageServiceExchange)
        {
            this.configuration = configuration;
             this.messageServiceExchange = messageServiceExchange;

             var messageHandlerTypesIndex = messageHandlerTypesIndexFactory.Create(new[] { messageHandlerType });
             this.messageHandlerInvoker = messageHandlerInvokerFactory.CreateAggregate(messageHandlerTypesIndex);
             this.messageType = messageHandlerTypesIndex.GetAllMessageTypes().Single();
        }
 public RabbitMQMessageListener(
  IChannelManagerFactory channelManagerFactory,
  Type[] messageHandlerTypes,
  IMessageHandlerTypesIndexFactory messageHandlerTypesIndexFactory,
  IMessageHandlerInvokerFactory messageHandlerInvokerFactory,
  IQueueNameConvention queueNameConvention,
  IMessageEncoder messageEncoder,
  IMessageSerialiser messageSerialiser,
  ILogger logger,
  IConfiguration configuration)
 {
     this.channelManager = channelManagerFactory.Create();
      this.queueNameConvention = queueNameConvention;
      this.messageEncoder = messageEncoder;
      this.messageSerialiser = messageSerialiser;
      this.logger = logger;
      this.configuration = configuration;
      this.messageHandlerTypesIndex = messageHandlerTypesIndexFactory.Create(messageHandlerTypes);
      this.messageHandlerInvoker = messageHandlerInvokerFactory.CreateAggregate(this.messageHandlerTypesIndex);
 }