This is a little note bucket for me today. I’m using Spring XD to help process some huge amounts of data that needs to be processed. Source software is writing to kafka, but I kept getting ASCII/byte arrays as my result.

Documentation here:
http://docs.spring.io/spring-xd/docs/current/reference/html/#kafka

Key part:
stream create myKafkaSource1 --definition "kafka --zkconnect=localhost:2181 --topic=mytopic | log" --deploy

What ISN’T in there, is to tell it to use a string value, not a byte value. I guess you can send any data through Kafka, but for me, I needed to get to my JSON. After a bunch of searching, I found this:

--outputType=text/plain

DOH. That would have been helpful.

stream create myKafkaSource1 --definition "kafka --zkconnect=localhost:2181 --topic=mytopic | log" --deploy --outputType=text/plain