atharvalade commented on code in PR #2711: URL: https://github.com/apache/iggy/pull/2711#discussion_r2818168812
########## examples/java/README.md: ########## @@ -64,6 +64,112 @@ You can also customize the server using environment variables: IGGY_HTTP_ENABLED=true IGGY_TCP_ADDRESS=0.0.0.0:8090 cargo run --bin iggy-server ``` +## Blocking vs. Async - When to Use Each + +The Iggy Java SDK provides two client types: **blocking (synchronous)** and **async (non-blocking)**. Choose based on your use case: + +### Use Blocking Client When + +- Message rate < 1000/sec +- Writing scripts, CLI tools, or simple applications +- Sequential code is easier to reason about +- Integration tests + +### Use Async Client When + +- Need > 5000 msg/sec throughput +- Application is already async/reactive (Spring WebFlux, Vert.x) +- Want to pipeline multiple requests over a single connection +- Building services that handle many concurrent streams + +### Performance Characteristics + +**Blocking Client:** + +- Throughput: ~5,000 msg/sec (varies with batch size, network latency) +- Thread usage: One thread per operation +- Latency: Low (one request at a time) + +**Async Client:** + +- Throughput: ~20,000+ msg/sec (with pipelining) Review Comment: fair -- 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]
