title: Problems adding multiple KafkaListenerContainerFactories
body: <p>Hi I'm currently dabbling in Spring Kafka and succeeded in adding a single KafkaListenerContainerFactory to my listener. Now I'd like to add multiple KafkaListenerContainerFactorys (One for a topic that will have messages in json, another one for strings). See code below:</p>
  
  <pre><code>@EnableKafka
  @Configuration
  public class KafkaConsumersConfig {
  
      private final KafkaConfiguration kafkaConfiguration;
  
      @Autowired
      public KafkaConsumersConfig(KafkaConfiguration kafkaConfiguration) {
          this.kafkaConfiguration = kafkaConfiguration;
      }
  
      @Bean
      public KafkaListenerContainerFactory&lt;?&gt; kafkaJsonListenerContainerFactory(){
          ConcurrentKafkaListenerContainerFactory&lt;String,Record&gt; factory = new ConcurrentKafkaListenerContainerFactory&lt;&gt;();
          factory.setConsumerFactory(jsonConsumerFactory());
          factory.setConcurrency(3);
          factory.setAutoStartup(true);
          return factory;
      }
  
      @Bean
      public ConsumerFactory&lt;String,Record&gt; jsonConsumerFactory(){
          JsonDeserializer&lt;Record&gt; jsonDeserializer = new JsonDeserializer&lt;&gt;(Record.class);
          return new DefaultKafkaConsumerFactory&lt;&gt;(jsonConsumerConfigs(),new StringDeserializer(), jsonDeserializer);
      }
  
      @Bean
      public Map&lt;String,Object&gt; jsonConsumerConfigs(){
          Map&lt;String,Object&gt; propsMap = new HashMap&lt;&gt;();
          propsMap.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,  kafkaConfiguration.getBrokerAddress());
          propsMap.put(ConsumerConfig.GROUP_ID_CONFIG, kafkaConfiguration.getJsonGroupId());
          propsMap.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, kafkaConfiguration.getAutoCommit());
          propsMap.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, kafkaConfiguration.getAutoCommitInterval());
          propsMap.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, kafkaConfiguration.getSessionTimeout());
          return propsMap;
      }
      @Bean
      public KafkaListenerContainerFactory&lt;?&gt; kafkaFileListenerContainerFactory(){
          ConcurrentKafkaListenerContainerFactory&lt;String,String&gt; factory = new ConcurrentKafkaListenerContainerFactory&lt;&gt;();
          factory.setConsumerFactory(fileConsumerFactory());
          factory.setConcurrency(3);
          factory.setAutoStartup(true);
          return factory;
      }
  
      @Bean
      public ConsumerFactory&lt;String,String&gt; fileConsumerFactory(){
          return new DefaultKafkaConsumerFactory&lt;&gt;(fileConsumerConfigs());
      }
  
      @Bean
      public Map&lt;String,Object&gt; fileConsumerConfigs(){
          Map&lt;String,Object&gt; propsMap = new HashMap&lt;&gt;();
          propsMap.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,  kafkaConfiguration.getBrokerAddress());
          propsMap.put(ConsumerConfig.GROUP_ID_CONFIG, kafkaConfiguration.getFileGroupId());
          propsMap.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, kafkaConfiguration.getAutoCommit());
          propsMap.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, kafkaConfiguration.getAutoCommitInterval());
          propsMap.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, kafkaConfiguration.getSessionTimeout());
          return propsMap;
      }
  }
  </code></pre>
  
  <p>Running this gives me the following error:</p>
  
  <pre><code>Description:
  
  Parameter 1 of method kafkaListenerContainerFactory in org.springframework.boot.autoconfigure.kafka.KafkaAnnotationDrivenConfiguration required a bean of type 'org.springframework.kafka.core.ConsumerFactory' that could not be found.
      - Bean method 'kafkaConsumerFactory' in 'KafkaAutoConfiguration' not loaded because @ConditionalOnMissingBean (types: org.springframework.kafka.core.ConsumerFactory; SearchStrategy: all) found beans 'jsonConsumerFactory', 'fileConsumerFactory'
  
  
  Action:
  
  Consider revisiting the conditions above or defining a bean of type 'org.springframework.kafka.core.ConsumerFactory' in your configuration.
  </code></pre>
  
  <p>What am I doing wrong?</p>