ApacheKafka—来自kafak的消息在SpringXD中以数字形式打印

fcy6dtqo  于 2021-06-08  发布在  Kafka
关注(0)|答案(0)|浏览(221)

我想做个简单的决定 spring-xd 实验。 Spring-xd 下载并以单节点模式运行。我们已经有一个 Kafka 我们有一个 spark streaming 从twitterapi读取tweets并将其推入 Kafka .
我正试着从你的书里读 Kafka 使用 spring-xd 并写入文件,因此我创建了以下流

xd:>stream create tweet --definition "kafka --zkconnect=zkserver:2181 --topic=tweets | file" --deploy

输出文件中的结果如下所示
123,34,105,100,34,58,34,116,97,103,58,115,101,97,114,99,104,46,116,119,105,116,116,101,114,46,99,111,109,44,50,48,48,53,58,55,54,54,48,55,55,56,57,52,50,51,55,57,55,48,52,51,50,34,44,34,111,98,106,101,99,116,84,121,112,101,34,58,34,97,99,116,105,118,105,116,121,34,44,34,97,99,116,111,114,34,58,123,34,111,98,106,101,99,116,84,121,112,101,34,58,34,112,101,114,115,111,110,34,44,34,105,100,34,58,34,105,100,58,116,119,105,116,116,101,114,46,99,111,109,58,50,56,49,54,51,54,52,57,52,55,34,44,34,108,105,110,107,34,58,34,104,116,116,112,58,47,47,119,119,119,46,116,119,105,116,116,101,114,46,99,111,109,47,67,82,82,111,103,101,114,115,53,34,44,34,100,105,115,112,108,97,121,78,97,109,101,34,58,34,71,50,32,67,104,97,114,108,105,101,34,44,34,112,111,115,116,101,100,84,105,109,101,34,58,34,50,48,49,52,45,49,48,45,48,56,84,50,49,58,52,54,58,50,56,46,48,48,48,90,34,44,34,105,109,97,103,101,34,58,34,104,116,116,112,115,58,47,47,112,98,115,46,116,119,105,109,103,46,99,111,109,47,112,114,111,102,105,108,101,95,105,109,97,103,101,115,47,55,51,49,50,55,53,53,55,50,56,49,53,53,51,50,48,51,50,47,89,84,66,109,89,113,78,111,95,110,111,114,109,97,108,46,106,112,103,34,44,34,115,117,109,109,97,114,121,34,58,110,117,108,108,44,34,108,105,110,107,115,34,58,91,123,34,104,114,101,102,34,58,110,117,108,108,44,34,114,101,108,34,58,34,109,101,34,125,93,44,34,102,114,105,101,110,100,115,67,111,117,110,116,34,58,55,49,50,44,34,102,111,108,108,111,119,101,114,115,67,111,117,110,116,34,58,52,57,52,44,34,108,105,115,116,101,100,67,111,117,110,116,34,58,54,48,44,34,115,116,97,116,117,115,101,115,67,111,117,110,116,34,58,51,57,53,50,53,44,34,116,119,105,116,116,101,114,84,105,109,101,90,111,110,101,34,58,34,69,97,115,116,101,114,110,32,84,105,109,101,32,40,85,83,32,38,32,67,97,110,97,100,97,41,34,44,34,118,101,114,105,102,105,101,100,34,58,102,97,108,115,101,44,34,117,116,99,79,102,102,115,101,116,34,58,34,45,49,52,52,48,48,34,44,34,112,114,101,102,101,114,114,101,100,85,115,101,114,110,97,109,101,34,58,34,67,82,82,111,103,101,114,115,53,34,44,34,108,97,110,103,117,97,103,101,115,34,58,91,34,101,110,34,93,44,34,108,111,99,97,116,105,111,110,34,58,123,34,111,98,106,101,99,116,84,121,112,101,34,58,34,112,108,97,99,101,34,44,34,100,105,115,112,108,97,121,78,97,109,101,34,58,34,67,84,34,125,44,34,102,97,118,111,114,105,116,101,115,67,111,117,110,116,34,58,51,53,57,125,44,34,118,101,114,98,34,58,34,115,104,97,114,101,34,44,34,112,111,115,116,101,100,84,105,109,101,34,58,34,50,48,49,54,45,48,56,45,49,56,84,48,52,58,48,50,58,53,55,46,48,48,48,90,34,44,34,103,101,110,101,114,97,116,111,114,34,58,123,34,100,105,115,112,108,97,121,78,97,109,101,34,58,34,84,119,105,116,116,101,114,32,102,111,114,32,105,80,104,111,110,101,34,44,34,108,105,110,107,34,58,34,104,116,116,112,58,47,47,116,119,105,116,116,101,114,46,99,111,109,47,100,111,119,110,108,111,97,100,47,105,112,104,111,110,101,34,125,44,34,112,114,111,118,105,100,101,114,34,58,123,34,111,98,106,101,99,116,84,121,112,101,34,58,34,115,101,114,118,105,99,101,34,44,34,100,105,115,112,108,97,121,78,97,109,101,34,58,34,84,119,105,116,116,101,114,34,44,34,108,105,110,107,34,58,34,104,116,116,112,58,47,47,119,119,119,46,116,119,105,116,116,101,114,46,99,111,109,34,125,44,34,108,105,110,107,34,58,34,104,116,116,112,58,47,47,116,119,105,116,116,101,114,46,99,111,109,47,67,82,82,111,103,101,114,115,53,47,115,116,97,116,117,115,101,115,47,55,54,54,48,55,55,56,57,52,50,51,55,57,55,48,52,51,50,34,44,34,98,111,100,121,34,58,34,82,84,32,64,115,116,101,112,104,57,51,48,54,53,58,32,78,101,119,116,58,32,84,114,117,109,112,32,73,83,73,83,32,83,112,101,101,99,104,32,39,72,105,115,116,111,114,105,99,39,32,45,32,39,77,111,115,116,32,73,109,112,111,114,116,97,110,116,32,70,111,114,101,105,103,110,32,80,111,108,105,99,121,32,83,112,101,101,99,104,32,83,105,110,99,101,32,82,111,110,97,108,100,32,82,101,97,103,97,110,39,32,45,32,66,114,101,105,116,98,97,114,116,32,104,116,116,112,115,58,47,47,116,46,99,111,47,50,105,-30,-128,-90,34,44,34,111,98,106,101,99,116,34,58,123,34,105,100,34,58,34,116,97,103,58,115,101,97,114,99,104,46,116,119,105,116,116,101,114,46,99,111,109,44,50,48,48,53,58,55,54,53,53,53,50,56,57,54,51,56,53,52,56,50,55,53,50,34,44,34,111,98,106,101,99,116,84,121,112,101,34,58,34,97,99,116,105,118,105,116,121,34,44,34,97,99,116,111,114,34,58,123,34,111,98,106,101,99,116,84,121,112,101,34,58,34,112,101,114,115,111,110,34,44,34,105,100,34,58,34,105,100,58,116,119,105,116,116,101,114,46,99,111,109,58,50,54,49,55,52,57,55,51,53,34,44,34,108,105,110,107,34,58,34,104,116,116,112,58,47,47,119,119,119,46,116,119,105,116,116,101,114,46,99,111,109,47,115,116,101,112,104,57,51,48,54,53,34,44,34,100,105,115,112,108,97,121,78,97,109,101,34,58,34,83,116,101,112,104,34,44,34,112,111,115,116,101,100,84,105,109,101,34,58,34,50,48,49,49,45,48,51,45,48,54,84,49,57,58,51,54,58,52,52,46,48,48,48,90,34,44,34,105,109,97,103,101,34,58,34,104,116,116,112,115,58,47,47,112,98,115,46,116,119,105,109,103,46,99,111,109,47,112,114,111,102,105,108,101,95,105,109,97,103,101,115,47,55,53,49,53,55,49,50,54,49,50,55,55,52,49,51,51,55,54,47,86,110,114,119,50,75,55,109,95,110,111,114,109,97,108,46,106,112,103,34,44,34,115,117,109,109,97,114,121,34,58,34,65,109,101,114,105,99,97,32,70,105,114,115,116,32,35,84,114,117,109,112,50,48,49,54,32,35,87,111,109,101,110,102,111,114,84,114,117,109,112,32,35,67,65,102,111,114,84,114,117,109,112,34,44,34,108,105,110,107,115,34,58,91,123,34,104,114,101,102,34,58,34,104,116,116,112,115,58,47,47,119,119,119,46,108,121,105,110,103,99,114,111,111,107,101,100,104,105,108,108,97,114,121,46,99,111,109,47,34,44,34,114,101,108,34,58,34,109,101,34,125,93,44,34,102,114,105,101,110,100,115,67,111,117,110,116,34,58,57,54,51,48,53,44,34,102,111,108,108,111,119,101,114,115,67,111,117,110,116,34,58,49,50,55,57,52,55,44,34,108,105,115,116,101,100,67,111,117,110,116,34,58,49,48,53,49,44,34,115,116,97,116,117,115,101,115,67,111,117,110,116,34,58,50,51,51,54,48,51,44,34,116,119,105,116,116,101,114,84,105,109,101,90,111,110,101,34,58,34,65,114,105,122,111,110,97,34,44,34,118,101,114,105,102,105,101,100,34,58,102,97,108,115,101,44,34,117,116,99,79,102,102,115,101,116,34,58,34,45,50,53,50,48,48,34,44,34,112,114,101,102,101,114,114,101,100,85,115,101,114,110,97,109,101,34,58,34,115,116,101,112,104,57,51,48,54,53,34,44,34,108,97,110,103,117,97,103,101,115,34,58,91,34,101,110,34,93,44,34,108,111,99,97,116,105,111,110,34,58,123,34,111,98,106,101,99,116,84,121,112,101,34,58,34,112,108,97,99,101,34,44,34,100,105,115,112,108,97,121,78,97,109,101,34,58,34,67,97,108,105,102,111,114,110,105,97,44,32,85,83,65,34,125,44,34,102,97,118,111,114,105,116,101,115,67,111,117,110,116,34,58,49,55,51,55,52,56,125,44,34,118,101,114,98,34,58,34,112,111,115,116,34,44,34,112,111,115,116,101,100,84,105,109,101,34,58,34,50,48,49,54,45,48,56,45,49,54,84,49,55,58,49,54,58,52,56,46,48,48,48,90,34,44,34,103,101,110,101,114,97,116,111,114,34,58,123,34,100,105,115,112,108,97,121,78,97,109,101,34,58,34,77,111,98,105,108,101,32,87,101,98,34,44,34,108,105,110,107,34,58,34,104,116,116,112,58,47,47,109,111,98,105,108,101,46,116,119,105,116,116,101,114,46,99,111,109,34,125,44,34,112,114,111,118,105,100,101,114,34,58,123,34,111,98,106,101,99,116,84,121,112,101,34,58,34,115,101,114,118,105,99,101,34,44,34,100,105,115,112,108,97,121,78,97,109,101,34,58,34,84,119,105,116,116,101,114,34,44,34,108,105,110,107,34,58,34,104,116,116,112,58,47,47,119,119,119,46,116,119,105,116,116,101,114,46,99,111,109,34,125,44,34,108,105,110,107,34,58,34,104,116,116,112,58,47,47,116,119,105,116,116,101,114,46,99,111,109,47,115,116,101,112,104,57,51,48,54,53,47,115,116,97,116,117,115,101,115,47,55,54,53,53,53,50,56,57,54,51,56,53,52,56,50,55,53,50,34,44,34,98,111,100,121,34,58,34,78,101,119,116,58,32,84,114,117,109,112,32,73,83,73,83,32,83,112,101,101,99,104,32,39,72,105,115,116,111,114,105,99,39,32,45,32,39,77,111,115,116,32,73,109,112,111,114,116,97,110,116,32,70,111,114,101,105,103,110,32,80,111,108,105,99,121,32,83,112,101,101,99,104,32,83,105,110,99,101,32,82,111,110,97,108,100,32,82,101,97,103,97,110,39,32,45,32,66,114,101,105,116,98,97,114,116,32,104,116,116,112,115,58,47,47,116,46,99,111,47,50,105,119,54,56,79,119,56,73,118,34,44,34,111,98,106,101,99,116,34,58,123,34,111,98,106,101,99,116,84,121,112,101,34,58,34,110,111,116,101,34,44,34,105,100,34,58,34,111,98,106,101,99,116,58,115,101,97,114,99,104,46,116,119,105,116,116,101,114,46,99,111,109,44,50,48,48,53,58,55,54,53,53,53,50,56,57,54,51,56,53,52,56,50,55,53,50,34,44,34,115,117,109,109,97,114,121,34,58,34,78,101,119,116,58,32,84,114,117,109,112,32,73,83,73,83,32,83,112,101,101,99,104,32,39,72,105,115,116,111,114,105,99,39,32,45,32,39,77,111,115,116,32,73,109,112,111,114,116,97,110,116,32,70,111,114,101,105,103,110,32,80,111,108,105,99,121,32,83,112,101,101,99,104,32,83,105,110,99,101,32,82,111,110,97,108,100,32,82,101,97,103,97,110,39,32,45,32,66,114,101,105,116,98,97,114,116,32,104,116,116,112,115,58,47,47,116,46,99,111,47,50,105,119,54,56,79,119,56,73,118,34,44,34,108,105,110,107,34,58,34,104,116,116,112,58,47,47,116,119,105,116,116,101,114,46,99,111,109,47,115,116,101,112,104,57,51,48,54,53,47,115,116,97,116,117,115,101,115,47,55,54,53,53,53,50,56,57,54,51,56,53,52,56,50,55,53,50,34,44,34,112,111,115,116,101,100,84,105,109,101,34,58,34,50,48,49,54,45,48,56,45,49,54,84,49,55,58,49,54,58,52,56,46,48,48,48,90,34,125,44,34,102,97,118,111,114,105,116,101,115,67,111,117,110,116,34,58,48,44,34,116,119,105,116,116,101,114,95,101,110,116,105,116,105,101,115,34,58,123,34,104,97,115,104,116,97,103,115,34,58,91,93,44,34,117,115,101,114,95,109,101,110,116,105,111,110,115,34,58,91,93,44,34,115,121,109,98,111,108,115,34,58,91,93,44,34,117,114,108,115,34,58,91,123,34,117,114,108,34,58,34,104,116,116,1

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题