databricks/zerobus-sdk rust/v0.4.0
databricks/zerobus-sdk
Captured source
source ↗published Jan 26, 2026seen Jun 26captured 2whttp 200method plain
Rust SDK v0.4.0
Repository: databricks/zerobus-sdk
Tag: rust/v0.4.0
Published: 2026-01-26T14:48:17Z
Prerelease: no
Release notes:
Release v0.4.0
New Features and Improvements
- Acknowledgment Callbacks: Added callback support for receiving notifications when records are acknowledged
- New
AckCallbacktrait withon_ack()andon_error()methods - Configurable via
ack_callbackfield inStreamConfigurationOptionsandArrowStreamConfigurationOptions
- Added support for
TINYINT/BYTE,TIMESTAMP_NTZ, andVARIANTdata types in the proto generation tool
- Alternative Ingestion API with Direct Offset Return: Added
ingest_record_offset()andingest_records_offset()methods - Return
OffsetId(logical offset) directly as an integer (after queuing) instead of wrapping it in a Future - Can be used with new
wait_for_offset()method to block on acknowledgment when needed - Allows decoupling record ingestion from acknowledgment tracking
- Useful for scenarios where you want to collect offsets and wait on them selectively
Deprecations
- Deprecated `ingest_record()` and `ingest_records()` methods: Use
ingest_record_offset()andingest_records_offset()instead - The new methods return offsets directly (after queuing) without Future wrapping for a cleaner API
- Use with
wait_for_offset()to explicitly wait for acknowledgments when needed - Old methods will continue to work but may be removed in a future version
Bug Fixes
- Improved error propagation in
wait_for_offset()andflush(): errors from the server are now detected and returned immediately instead of waiting for timeout, providing faster feedback and more accurate error messages
- Improved error classification in OAuth token retrieval: 5xx server errors and network failures are now retryable, while 4xx client errors (invalid credentials, etc.) are non-retryable
Documentation
Internal Changes
- Refactored
wait_for_offset_internalto remove unnecessary double loop - Optimized gRPC channel reuse:
ZerobusSdknow reuses a single gRPC channel across multiple stream creations instead of creating a new channel for each stream, improving connection efficiency and reducing resource overhead - Enhanced background tasks with
is_closedchecks and proper error broadcasting to the shared error channel, ensuring timely shutdown and accurate error reporting
- Added
user-agentheader to all gRPC requests for SDK version tracking
- Refactored
flush()andwait_for_offset()to share common waiting logic viawait_for_offset_internal(), reducing code duplication and ensuring consistent behavior
- Improved graceful close mechanism: when server signals stream closure, SDK now continues processing acknowledgments for in-flight records while pausing new record transmission until timeout.
API Changes
- [BREAKING] Added
callback_max_wait_time_mstoStreamConfigurationOptionsto limit how long callbacks may run after stream closure (None= infinite,Some(x)=xms). - Added
ack_callback: Option>field toStreamConfigurationOptionsandArrowStreamConfigurationOptionsfor acknowledgment callbacks - Added
AckCallbacktrait withon_ack(offset_id)andon_error(offset_id, error_message)methods
- Added Arrow IPC compression support via
ipc_compression: OptioninArrowStreamConfigurationOptions(supportsLZ4_FRAMEandZSTD, default:None) - [BREAKING] Changed
ZerobusArrowStream::ingest_batch()to returnOffsetIddirectly instead ofFuture. Usewait_for_offset(offset)to explicitly wait for acknowledgment - Added
ZerobusArrowStream::wait_for_offset()method to wait for acknowledgment of a specific offset - Added
is_closedcheck at the beginning offlush()for bothZerobusStreamandZerobusArrowStream
- Added
ingest_record_offset()method toZerobusStreamfor direct offset return without Future wrapping - Added
ingest_records_offset()method toZerobusStreamfor batch ingestion with direct offset return - Added
wait_for_offset()method toZerobusStreamto wait for acknowledgment of a specific offset
- [BREAKING] Added
stream_paused_max_wait_time_mstoStreamConfigurationOptionsto configure maximum wait time during graceful stream close (None= wait for full server duration,Some(0)= immediate recovery,Some(x)= wait up to min(x, server_duration) milliseconds)