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 byte[]
.
This means that my SI @Header
parameters need to be of type byte[]
. Which works, but it'd be nice to have them as Strings (all the inbound headers I care about are String values).
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.
I'm obviously missing something here. Any tips?