title: Spring Kafka Consumer printing incorrect headers
body: <p>I am using Spring Boot's <code>KafkaListener</code> to consume events from a Kafka topic. I am interested in reading the headers for the events. I am able to get the correct value of individual headers when I read them individually but when I try to read it as a map, the values seem different.</p>
  <p>This is what my code looks like:</p>
  <pre><code>public final class KafkaConsumer {
  
    @KafkaListener(
        topics = &quot;#{'${event.consumer.topics}'.split(',')}&quot;,
        groupId = &quot;${event.consumer.groupId}&quot;,
        containerFactory = &quot;kafkaListenerFactory&quot;)
    public void receive(
        ConsumerRecord&lt;String, Object&gt; consumerRecord,
        @Header(&quot;foo&quot;) String foo,
        @Headers Map&lt;String, String&gt; header,
        Acknowledgment acknowledgment) {
  
      try {
        System.out.println(foo);
        System.out.println(header.get(&quot;foo&quot;);
        acknowledgment.acknowledge();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  </code></pre>
  <p>The first print statement gives the correct value (bar) but the second statement prints some garbage ([B@5f1af89d). Can someone let me know how to read the headers correctly as a map?</p>