Closed rollbor closed 6 months ago
Hello, I have had some problems using this crate recently, I would like to ask you to help take a look, thank you very much! Appreciate!!!
thread 'tokio-runtime-worker' panicked at 'produce error:: Client(Request(NoVersionMatch { api_key: Produce }))', src\main.rs:110:44
cargo run
async fn test_batch_producer() { let connection = "127.0.0.1:9092".to_owned(); let client = ClientBuilder::new(vec![connection]).build().await.unwrap(); let topic = "test"; // produce some data let record = Record { key: Option::from(b"".to_vec()), value: Option::from(b"hello kafka".to_vec()), headers: Default::default(), timestamp: Default::default(), }; let partition_client = Arc::new( client .partition_client(&*topic, 0, UnknownTopicHandling::Retry) .await .unwrap(), ); let producer = BatchProducerBuilder::new(partition_client) .with_linger(Duration::from_secs(5)) .build(RecordAggregator::new(record.approximate_size() * 2 + 1)); producer.produce(record.clone()).await.expect("produce error: "); }
rskafka doesn't support old Kafka versions, mostly because the complexity of protocol becomes a too high.
rskafka
Hello, I have had some problems using this crate recently, I would like to ask you to help take a look, thank you very much! Appreciate!!!
Error details log
thread 'tokio-runtime-worker' panicked at 'produce error:: Client(Request(NoVersionMatch { api_key: Produce }))', src\main.rs:110:44
Environment in
Execute the command
Source