ryerraguntla commented on code in PR #3519:
URL: https://github.com/apache/iggy/pull/3519#discussion_r3528489056


##########
gateways/kafka/tools/kafka-tool/src/main.rs:
##########
@@ -0,0 +1,894 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use anyhow::{Context, Result};
+use bytes::{BufMut, Bytes, BytesMut};
+use clap::{Parser, Subcommand};
+use kafka_protocol::messages::*;
+use kafka_protocol::protocol::{Encodable, StrBytes};
+use std::path::PathBuf;
+use tokio::io::{AsyncReadExt, AsyncWriteExt};
+use tokio::net::TcpStream;
+use tracing::{info, warn};
+
+mod response;
+
+#[derive(Parser)]
+#[command(
+    name = "kafka-message-gen",
+    about = "Generate Kafka wire protocol binary messages for all API keys and 
versions",
+    long_about = "Generates correctly-framed Kafka protocol requests from 
Kafka 4.1.0 schemas.\n\
+Each output .bin file is TCP-ready: 
[len:i32][api_key:i16][api_version:i16][correlation_id:i32][client_id][payload]"
+)]
+struct Cli {
+    #[command(subcommand)]
+    command: Command,
+}
+
+#[derive(Subcommand)]
+enum Command {
+    /// List all supported API keys with name and version range
+    List,
+    /// Generate binary .bin files for all API keys and versions
+    Generate {
+        #[arg(short, long, default_value = "kafka_messages")]
+        output: PathBuf,
+        /// Filter to a single API key integer
+        #[arg(long)]
+        api_key: Option<i16>,

Review Comment:
   Fixed the PR description with one api-key at a time.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to