Hangleton opened a new pull request, #13214: URL: https://github.com/apache/kafka/pull/13214
Code move for the `consoleProducer` as part of KAFKA-14525 - Move CLI tools from `core` to `tools` module. The copy is as identical as possible as the original class and provides iso-functionality. Unit tests are moved as well for `ConsoleProducer` and `LineMessageReader`. One minor additional unit test for the console producer. Tests: - Refactored unit tests `ConsoleProducerTest` and `LineMessageReaderTest`. - Manual exercise of the CLI tool. ``` Option Description ------ ----------- --batch-size <Integer: size> Number of messages to send in a single batch if they are not being sent synchronously. please note that this option will be replaced if max- partition-memory-bytes is also set (default: 16384) --bootstrap-server <String: server to REQUIRED unless --broker-list connect to> (deprecated) is specified. The server (s) to connect to. The broker list string in the form HOST1:PORT1,HOST2: PORT2. --broker-list <String: broker-list> DEPRECATED, use --bootstrap-server instead; ignored if --bootstrap- server is specified. The broker list string in the form HOST1:PORT1, HOST2:PORT2. --compression-codec [String: The compression codec: either 'none', compression-codec] 'gzip', 'snappy', 'lz4', or 'zstd'. If specified without value, then it defaults to 'gzip' --help Print usage information. --line-reader <String: reader_class> The class name of the class to use for reading lines from standard in. By default each line is read as a separate message. (default: org. apache.kafka.tools. ConsoleProducer$LineMessageReader) --max-block-ms <Long: max block on The max time that the producer will send> block for during a send request. (default: 60000) --max-memory-bytes <Long: total memory The total memory used by the producer in bytes> to buffer records waiting to be sent to the server. This is the option to control `buffer.memory` in producer configs. (default: 33554432) --max-partition-memory-bytes <Integer: The buffer size allocated for a memory in bytes per partition> partition. When records are received which are smaller than this size the producer will attempt to optimistically group them together until this size is reached. This is the option to control `batch.size` in producer configs. (default: 16384) --message-send-max-retries <Integer> Brokers can fail receiving the message for multiple reasons, and being unavailable transiently is just one of them. This property specifies the number of retries before the producer give up and drop this message. This is the option to control `retries` in producer configs. (default: 3) --metadata-expiry-ms <Long: metadata The period of time in milliseconds expiration interval> after which we force a refresh of metadata even if we haven't seen any leadership changes. This is the option to control `metadata.max.age. ms` in producer configs. (default: 300000) --producer-property <String: A mechanism to pass user-defined producer_prop> properties in the form key=value to the producer. --producer.config <String: config file> Producer config properties file. Note that [producer-property] takes precedence over this config. --property <String: prop> A mechanism to pass user-defined properties in the form key=value to the message reader. This allows custom configuration for a user- defined message reader.Default properties include: parse.key=false parse.headers=false ignore.error=false key.separator=\t headers.delimiter=\t headers.separator=, headers.key.separator=: null.marker= When set, any fields (key, value and headers) equal to this will be replaced by null Default parsing pattern when: parse.headers=true and parse.key=true: "h1:v1,h2:v2...\tkey\tvalue" parse.key=true: "key\tvalue" parse.headers=true: "h1:v1,h2:v2...\tvalue" --reader-config <String: config file> Config properties file for the message reader. Note that [property] takes precedence over this config. --request-required-acks <String: The required `acks` of the producer request required acks> requests (default: -1) --request-timeout-ms <Integer: request The ack timeout of the producer timeout ms> requests. Value must be non-negative and non-zero. (default: 1500) --retry-backoff-ms <Long> Before each retry, the producer refreshes the metadata of relevant topics. Since leader election takes a bit of time, this property specifies the amount of time that the producer waits before refreshing the metadata. This is the option to control `retry.backoff.ms` in producer configs. (default: 100) --socket-buffer-size <Integer: size> The size of the tcp RECV size. This is the option to control `send.buffer. bytes` in producer configs. (default: 102400) --sync If set message send requests to the brokers are synchronously, one at a time as they arrive. --timeout <Long: timeout_ms> If set and the producer is running in asynchronous mode, this gives the maximum amount of time a message will queue awaiting sufficient batch size. The value is given in ms. This is the option to control `linger.ms` in producer configs. (default: 1000) --topic <String: topic> REQUIRED: The topic id to produce messages to. --version Display Kafka version. ``` ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org