I use Kafka streams DSL and map to convert a KStream<String, JsonNode> to KStream<String, String>.
In ValueMapper function, I simple return new ValueMapper("key", "some constant string"), but where the value is sent back to Kafka use KStream.to("some topic"), I got the result is being added double quotes.
my code is like this:
KStream<String, JsonNode> views = builder.stream("fromTopic");
views.map(new ValueKMapper()).to("toTopic");
and ValueMapper simply implements KeyValueMapper and the code of apply() is:
public KeyValue<String, String> apply(String key, JsonNode value)
{
return new KeyValue<String,String>("a", "hello");
}
and then when I consume the toTopic, I got the ""hello"", with quotes added.
Maybe it's a bug of Kafka streams?