title: Kafka consumer - Reading message header before deserializing
body: <p>Is there any way to read message headers before deserializing?</p>
  <p>I have written the below code, but I am forced to deserializing here, any way to not deserialize?</p>
  <pre><code>    while (true) {
  
          ConsumerRecords&lt;String, String&gt; consumerRecords = consumer.poll(Duration.ofSeconds(1));
          for (ConsumerRecord&lt;String, String&gt; consumerRecord : consumerRecords) {
              for (Header header : consumerRecord.headers()) {
                  if (header.key().equals(&quot;my header&quot;)) {
                      String data = &quot;\n New record received .. \n&quot; +
                              &quot; Value: &quot; + consumerRecord.value() +
                              &quot; Topic: &quot; + consumerRecord.topic() +
                              &quot; Header: &quot; + header.key() +
                              &quot; Partition: &quot; + consumerRecord.partition();
  
                      logger.info(data);
                  }
              }
          }
      }
  </code></pre>