Zzaniu opened a new issue, #2968:
URL: https://github.com/apache/iggy/issues/2968
### When I use HTTP, it can be sent. However, when I use TCP, it will report
an error: Error: Missing index: 0
### Bug description
#### code:
```rust
let mut args = Args::default();
args.username = "cop_test".to_owned();
args.password = "cop_test".to_owned();
args.tcp_server_address = "127.0.0.1:8090".to_owned();
// args.transport = "http".to_owned();
args.http_api_url = "http://127.0.0.1:3000".to_owned();
let client_provider_config =
Arc::new(ClientProviderConfig::from_args(args)?);
let client = client_provider::get_raw_client(client_provider_config,
false).await?;
println!("Using client: {client:#?}");
let client = IggyClient::new(client);
client.connect().await?;
// 如果是 http, 需要显式登录
if let ClientWrapper::Http(_) = *client.client().read().await {
let login_status = client.login_user("cop_test", "cop_test").await?;
println!("login_status {:?}", login_status);
}
let stream_id = Identifier::try_from("cop")?;
let stream = client.get_stream(&stream_id).await?;
println!("stream: {:?}", stream);
let topic_id = Identifier::try_from("cop_test")?;
let topic = client.get_topic(&stream_id, &topic_id).await?;
println!("topic: {:?}", topic);
let mut messages = Vec::new();
let message = IggyMessage::builder()
.payload(bytes::Bytes::from("Hello iggy"))
.build()?;
messages.push(message);
let partitioning = Partitioning::balanced();
client
.send_messages(&stream_id, &topic_id, &partitioning, &mut messages)
.await?;
tokio::time::sleep(Duration::from_millis(10000)).await;
Ok(())
```
#### Execution error: `Error: Missing index: 0`
#### Server log:
```log
ERROR shard-1 trace_send_messages{iggy_user_id=1 iggy_client_id=4161933783
iggy_stream_id="0" iggy_topic_id="0" partitioning=balanced|0}:
iggy_common::types::message::messages_batch_mut: Message at index 0 is missing,
or message size is less than minimum message size 64 B (header)
```
```toml
[dependencies]
iggy = { version = "=0.7.0" }
```
#### Server version: `0.7.0`
#### PC: `win11 + AMD9700X`
--
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]