haze518 opened a new pull request, #1838: URL: https://github.com/apache/iggy/pull/1838
This PR introduces support for **sending messages in the background** — with built-in batching, sharding, buffer limits, and custom error handling. The feature is based on [discussion #1593](https://github.com/apache/iggy/discussions/1593) and aims to improve client-side performance under high load. - The `IggyProducer` now supports two modes: - **Sync mode** — works like before, sending messages immediately. - **Background mode** — messages are buffered and sent by background workers. - A new `BackgroundBuilder` allows configuring: - `batch_length`: how many messages to buffer before sending. - `linger_time`: how long to wait before flushing a batch. - `batch_size`: max size of a batch in bytes. - `max_buffer_size`: total buffer size allowed. - `max_in_flight`: limits the number of in-flight batches. - `failure_mode`: defines how to behave when limits are hit (block, timeout, or fail). - `sharding`: custom shard picking strategies (e.g. round-robin, hash-based). - `error_callback`: handles background send errors (e.g. logging, retries, DLQs). - Comes with sensible defaults: - `BalancedSharding` — simple round-robin across shards. - `LogErrorCallback` — logs background send failures using `tracing::error!`. -- 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]
