title: Spring kafka @KafkaListener is not being invoked
body: <p>I'm trying to integrate kafka with my Spring boot (v2.0.6.RELEASE) app using spring-kafka. For now I want to have a consumer and a producer. I got the producer to work just fine, I can see the messages being sent to the topic through a console consumer. I can't get the consumer code to work, it does not get invoked when a new message appears in the kafka topic.</p>
  
  <p>Here is my kafka configuration class:</p>
  
  <pre><code>
  @Configuration
  @EnableKafka
  public class KafkaConfiguration {
  
      @Bean
      public Map&lt;String, Object&gt; producerConfigs() {
          Map&lt;String, Object&gt; props = new HashMap&lt;&gt;();
  
          props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");
          props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, &lt;path to my custom serializer&gt;);
          props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
  
          return props;
      }
  
      @Bean
      public Map&lt;String, Object&gt; consumerConfigs(){
          Map&lt;String, Object&gt; props = new HashMap&lt;&gt;();
  
          props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer");
          props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, &lt;path to my custom deserializer&gt;);
          props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
  //        props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
  
          return props;
      }
  
      @Bean
      public ConsumerFactory&lt;String, List&lt;MyMessage&gt;&gt; consumerFactory() {
          return new DefaultKafkaConsumerFactory&lt;&gt;(consumerConfigs());
      }
  
      @Bean
      public KafkaListenerContainerFactory&lt;ConcurrentMessageListenerContainer&lt;String, List&lt;MyMessage&gt;&gt;&gt; kafkaListenerContainerFactory() {
          ConcurrentKafkaListenerContainerFactory&lt;String, List&lt;MyMessage&gt;&gt; factory = new ConcurrentKafkaListenerContainerFactory&lt;&gt;();
          factory.setConsumerFactory(consumerFactory());
          return factory;
      }
  
      @Bean
      public ProducerFactory&lt;String, List&lt;MyMessage&gt;&gt; producerFactory() {
          return new DefaultKafkaProducerFactory&lt;&gt;(producerConfigs());
      }
  
      @Bean
      public KafkaTemplate&lt;String, List&lt;MyMessage&gt;&gt; kafkaTemplate() {
          return new KafkaTemplate&lt;&gt;(producerFactory());
      }
  
  }
  </code></pre>
  
  <p>Here is my pom dependency:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.kafka&lt;/groupId&gt;
    &lt;artifactId&gt;spring-kafka&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>And the consumer code:</p>
  
  <pre><code>
  @Slf4j
  public class MyMessageConsumer {
  
      @KafkaListener(topicPattern = "test_topic")
      public void receive(List&lt;MyMessage&gt; myMessages){
          log.info("Received payload {}", myMessages);
      }
  }
  </code></pre>
  
  <p>I am running kafka on my computer and as I said - I can see the messages appearing in the console consumer. What could be the reason that my Spring based consumer won't receive messages?</p>
  
  <p>EDIT:
  Here is the deserializer class:</p>
  
  <pre><code>
  public class TagEventDeserializer implements Deserializer&lt;List&lt;MyMessage&gt;&gt; {
      @Override
      public void configure(Map map, boolean b) {
  
      }
  
      @Override
      public List&lt;MyMessage&gt; deserialize(String s, byte[] bytes) {
          ObjectMapper objectMapper = new ObjectMapper();
          List&lt;MyMessage&gt; myMessages = null;
          try{
              myMessages = objectMapper.readValue(bytes , List.class);
          } catch (Exception e){
              e.printStackTrace();
          }
          return myMessages;
      }
  
      @Override
      public void close() {
  
      }
  }
  </code></pre>