title: How to access Kafka headers while consuming a message?
body: <p>Below are my configuration</p>
  
  <pre><code>&lt;int-kafka:inbound-channel-adapter id="kafkaInboundChannelAdapter"
              kafka-consumer-context-ref="consumerContext"
              auto-startup="true"
              channel="inputFromKafka"&gt;
          &lt;int:poller fixed-delay="1" time-unit="MILLISECONDS" /&gt;
      &lt;/int-kafka:inbound-channel-adapter&gt;
  </code></pre>
  
  <p><code>inputFromKafka</code> goes through transformation below </p>
  
  <pre><code>public Message&lt;?&gt; transform(final Message&lt;?&gt; message) {
  
  System.out.println( "KAFKA Message Headers " + message.getHeaders());
  
  final Map&lt;String, Map&lt;Integer, List&lt;Object&gt;&gt;&gt; origData =  (Map&lt;String, Map&lt;Integer, List&lt;Object&gt;&gt;&gt;) message.getPayload();
  
          // some code to figure-out the nonPartitionedData
          return MessageBuilder.withPayload(nonPartitionedData).build();
      }
  </code></pre>
  
  <p>The print statement from above  prints only two consistent headers regardless </p>
  
  <p><code>KAFKA Message Headers {id=9c8f09e6-4b28-5aa1-c74c-ebfa53c01ae4, timestamp=1437066957272}</code></p>
  
  <p>While Sending a Kafka message some headers were passed including <code>KafkaHeaders.MESSAGE_KEY</code> but I am not getting back that either, wondering if there is away to accomplish this?</p>