title: Kafka Listener - Configure Interceptor in Spring Boot?
body: <p>I am trying to configure the Confluent - ConsumerTimestampsInterceptor to support the Confluent KAFKA Replication and have configured Java spring boot application as mentioned below</p>
  <p><strong>application.properties</strong></p>
  <pre><code>#consumer timestamp interceptor
  interceptor.classes=io.confluent.connect.replicator.offsets.ConsumerTimestampsInterceptor
  timestamp.producer.security.protocol=PLAINTEXT
  timestamp.producer.sasl.mechanism=NONE
  #timestamp.producer.ssl.endpoint.identification.algorithm=
  #timestamp.producer.sasl.jaas.config=
  src.consumer.group.id=lkc-302y2
  </code></pre>
  <p><strong>Consumer.java</strong></p>
  <pre><code>package com.example.demo.service;
  
  import org.springframework.kafka.annotation.KafkaListener;
  import org.springframework.stereotype.Service;
  
  import com.example.demo.model.ProductKafka;
  
  import java.io.IOException;
  import java.util.ArrayDeque;
  import java.util.LinkedList;
  import java.util.Queue;
  import java.util.logging.Logger;
  
  @Service
  public class Consumer {
      private static final Logger LOGGER = Logger.getLogger(Consumer.class.getName());
      public static ArrayDeque&lt;ProductKafka&gt; consumeQueue = new ArrayDeque&lt;&gt;();
      
      @KafkaListener(autoStartup = &quot;false&quot;, topics = &quot;#{'${spring.kafka.topics}'.split('\\\\ ')}&quot;, groupId = &quot;#{'${spring.kafka.groupId}'}&quot;)
      public void consume(ProductKafka productKafka) throws IOException {
          consumeQueue.offer(productKafka);
  
          LOGGER.info(String.format(&quot;#### -&gt; Logger Consumed message -&gt; %s&quot;, productKafka.toString()));
          System.out.printf(&quot;#### -&gt; Consumed message -&gt; %s&quot;, productKafka.toString());
      }
  }
  </code></pre>
  <p>and below is the project structure</p>
  <p><a href="https://i.stack.imgur.com/fz0iR.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>however it is not working.</p>
  <p>Our KAFKA administrator mentioned that though I have the Interceptor added KAFKA consumer is not configured to use the interceptor.</p>
  <p>I don't know how to make the consumer use the Interceptor</p>