ReleaseDatabricks (DBRX)Databricks (DBRX)published Jan 26, 2026seen Jun 26

databricks/zerobus-sdk rust/v0.4.0

databricks/zerobus-sdk

Open original ↗

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 AckCallback trait with on_ack() and on_error() methods
  • Configurable via ack_callback field in StreamConfigurationOptions and ArrowStreamConfigurationOptions
  • Added support for TINYINT/BYTE, TIMESTAMP_NTZ, and VARIANT data types in the proto generation tool
  • Alternative Ingestion API with Direct Offset Return: Added ingest_record_offset() and ingest_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() and ingest_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() and flush(): 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_internal to remove unnecessary double loop
  • Optimized gRPC channel reuse: ZerobusSdk now 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_closed checks and proper error broadcasting to the shared error channel, ensuring timely shutdown and accurate error reporting
  • Added user-agent header to all gRPC requests for SDK version tracking
  • Refactored flush() and wait_for_offset() to share common waiting logic via wait_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_ms to StreamConfigurationOptions to limit how long callbacks may run after stream closure (None = infinite, Some(x) = x ms).
  • Added ack_callback: Option> field to StreamConfigurationOptions and ArrowStreamConfigurationOptions for acknowledgment callbacks
  • Added AckCallback trait with on_ack(offset_id) and on_error(offset_id, error_message) methods
  • Added Arrow IPC compression support via ipc_compression: Option in ArrowStreamConfigurationOptions (supports LZ4_FRAME and ZSTD, default: None)
  • [BREAKING] Changed ZerobusArrowStream::ingest_batch() to return OffsetId directly instead of Future. Use wait_for_offset(offset) to explicitly wait for acknowledgment
  • Added ZerobusArrowStream::wait_for_offset() method to wait for acknowledgment of a specific offset
  • Added is_closed check at the beginning of flush() for both ZerobusStream and ZerobusArrowStream
  • Added ingest_record_offset() method to ZerobusStream for direct offset return without Future wrapping
  • Added ingest_records_offset() method to ZerobusStream for batch ingestion with direct offset return
  • Added wait_for_offset() method to ZerobusStream to wait for acknowledgment of a specific offset
  • [BREAKING] Added stream_paused_max_wait_time_ms to StreamConfigurationOptions to 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)