我正在用spring-xd測試apache-kafka。spring-xd kafka水槽(文件)寫ascii代碼
它工作正常,我正在接觸spring-xd。
xd> stream create kafka-source-test --definition "kafka --zkconnect=localhost:2181 --topic=event-stream | log" --deploy
我發送json字符串給kafka。
{ 「名」: 「tester1」, 「年齡」: 「0」}
它的工作原理,但記錄是
INFO dispatcher-1 sink.kafka-source-test - [[email protected]
所以我儘量sink.file
xd> stream create kafka-source-test --definition "kafka --zkconnect=localhost:2181 --topic=event-stream | file" --deploy
並簽出放文件 我遇到了這個ascii碼
123,34,110,97,109,101,34,58,34,116,101,115,116,101,114,50,34,44,34,97,103,101,34,58,49,125
這意味着這個JSON字符串。
{ 「名」: 「tester1」, 「年齡」: 「0」}
?我怎樣才能用JSON字符串味精? 幫幫我!
是的,謝謝。更具體地說:'stream create kafka-source-test --definition「kafka --zkconnect = localhost:2181 --topic = event-stream --outputType = text/plain | file」--deploy' –