以嵌套Json格式往kafka写数据,每条消息都多一行空格
moody1117 opened this issue · 1 comments
json.txt:
{"name":"[:name]","age":[:age],"school":{"sch_name":"[:enum(file://names.txt)]","sch_address":"[:address]","scores":[{"class":"[:enum(Math,English)]","score":[:decimal(4,2,1)]}]}}
启动命令:
datafaker kafka node06.jstdata.com:9092 caolvtest 100 --metaj json.txt --interval 0.5 --outprint
{"name":"杨东","age":84,"school":{"sch_name":"旧大院","sch_address":"重庆市武汉县浔阳沈阳街g座 894541","scores":[{"class":"Math","score":36.84}]}}
insert 1 records
{"name":"刘凤兰","age":92,"school":{"sch_name":"广东中学","sch_address":"四川省秀梅市永川柳州路D座 283004","scores":[{"class":"Math","score":85.53}]}}
insert 2 records
{"name":"李涛","age":99,"school":{"sch_name":"人和中心","sch_address":"江西省潮州县涪城吴路T座 323229","scores":[{"class":"Math","score":6.78}]}}
insert 3 records
{"name":"王秀梅","age":15,"school":{"sch_name":"旧大院","sch_address":"澳门特别行政区浩县淄川秦路S座 701829","scores":[{"class":"English","score":81.15}]}}
insert 4 records
{"name":"王芳","age":90,"school":{"sch_name":"旧大院","sch_address":"浙江省萍市清浦贵阳路K座 465548","scores":[{"class":"English","score":94.8}]}}
问题已解决,给您提交了pull request