title: How can I map incoming headers as String instead of byte[] in my Spring Cloud Stream project?
body: <p>I have a simple Spring Cloud Stream project using Spring Integration DSL flows and using the Kafka binder. Everything works great, but message header values coming from Kafka arrive as <code>byte[]</code>.</p>
  
  <p>This means that my SI <code>@Header</code> parameters need to be of type <code>byte[]</code>. Which works, but it'd be nice to have them as Strings (all the inbound headers I care about are String values).</p>
  
  <p>I've configured the Kafka clients to use StringSerializer/StringDeserializer. I assume I also need to somehow tell Spring Kafka which headers to map as Strings and what character encoding to use. </p>
  
  <p>I'm obviously missing something here. Any tips?</p>