Closed moming00 closed 1 year ago
there is voice suggesting to use the compiled proto file, will reopen the PR after everything settled
fwiw compiled proto file might be difficult to use as well -- I usually work with the non-compiled files. Perhaps support both in the same flag?
fwiw compiled proto file might be difficult to use as well -- I usually work with the non-compiled files. Perhaps support both in the same flag?
this may be the solution =)
Awesome, lgtm, ty. I'll bump the latest franz pin and release.
hello, it will be good if kcl supports unmarshalling kafka messages in protobuf format to Json. So introduced two commandline options: --proto-file to specify the Proto Source File or ProtoSet File which includes the original message defination, --proto-message to specify the message name in "packageName.messageName" format. For example:
kcl consume mytopic -n=1 --proto-file=/usr/local/src/proto_Generator/sample.proto --proto-message=sample.FileState
kcl consume mytopic -n=1 --proto-file=/usr/local/src/proto_Generator/sample.protoset --proto-message=sample.FileState
this could return message like:
{ "Message": "Hello World", "Id": "7b1271413a48a80cfa0c38e83788b32a", "Timestamp": "2022-12-13T16:03:30.760+08:00", "HostName": "ck10", "Path": "/data01//flow.log", "RowNumer": "59", "Seq": "59", "TaskId": "111359604125616", "Topic": "fc111359604125096", "IP": "192.168.110.66" }
proto-file with "protoset" format supposed to be more efficient, as which already includs compiled info from source proto file, so requires no parsing in runtime. Aslo protoset file could be self-contained if
--include_imports
is specified when generating the file, while proto souce file may require additional efforts to locate the imported protos.