Created
April 29, 2020 07:59
-
-
Save billydh/84b6514407a14f42ad27900aceaf21c0 to your computer and use it in GitHub Desktop.
Modified parse_command_line_args to adjust for Avro Consumer code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from argparse import ArgumentParser | |
| def parse_command_line_args(): | |
| arg_parser = ArgumentParser() | |
| arg_parser.add_argument("--topic", required=True, help="Topic name") | |
| arg_parser.add_argument("--bootstrap-servers", required=False, default="localhost:9092", help="Bootstrap server address") | |
| arg_parser.add_argument("--schema-registry", required=False, default="http://localhost:8081", help="Schema Registry url") | |
| arg_parser.add_argument("--schema-file", required=False, help="File name of Avro schema to use") | |
| arg_parser.add_argument("--record-key", required=False, type=str, help="Record key. If not provided, will be a random UUID") | |
| arg_parser.add_argument("--record-value", required=False, help="Record value") | |
| return arg_parser.parse_args() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment