databricks/zerobus-sdk rust/v1.3.0
databricks/zerobus-sdk
Captured source
source ↗Rust SDK v1.3.0
Repository: databricks/zerobus-sdk
Tag: rust/v1.3.0
Published: 2026-05-12T14:43:38Z
Prerelease: no
Release notes:
New Features and Improvements
- Arrow Flight — graceful stream close: When the server signals that the stream will close, the SDK enters a paused state: it stops sending new batches, drains in-flight acknowledgments up to a configurable wait, then recovers.
- `stream_paused_max_wait_time_ms` on
ArrowStreamConfigurationOptions: Optional cap (milliseconds) on how long to wait during that paused phase (None= use full server duration,Some(0)= recover immediately,Some(x)= wait up tomin(x, server_duration)). - Added
ZerobusSdkBuilder::connector_factoryfor programmatic proxy
configuration. Callers can install a ConnectorFactory (a Fn(&str) -> Option closure) that fully overrides the default env-var proxy detection — useful for embedders that already model proxy config in their own configuration system (e.g. Vector's ProxyConfig). When no factory is installed, the existing grpc_proxy / https_proxy / http_proxy env-var behavior is unchanged.
- The env-var proxy path now supports
https://proxy URLs. The client→proxy
hop does a TLS handshake using the system trust store; the CONNECT tunnel still carries raw TCP so tonic applies end-to-end TLS to the target endpoint on top.
- `StreamBuilder` API: New fluent builder for creating ingestion streams.
Setters can be called in any order; the builder validates at build() time that both authentication and format have been configured.
Bug Fixes
- gRPC / HTTP/2 teardown on close and recovery: Receive and send tasks now shut down with a per-stream
CancellationToken, bounded waits beforeabort, and a separaterecv_drain_tokenon the receiver. This avoids racing `RST_STREAM` / `CANCEL` from the client against `END_STREAM` from the server—failure modes that could show up as HTTP/2 protocol errors or broken pipe on the server. - After the inbound receive loop exits, the response-stream drain is now split by exit reason: the close path (
recv_drain_token) drains inline so the server seesEND_STREAMbefore the client process exits and the runtime tears down; the recovery / error paths drain in a detached task soflush()and stream recovery aren't delayed. - `StreamBuilder::stream_paused_max_wait_time_ms`: Now updates Arrow stream settings (
arrow_config) as well as JSON/proto gRPC settings, so.build_arrow()respects this option (previously only JSON/proto streams saw the value).
Internal Changes
- Reduced log verbosity in
wait_for_offset/wait_for_ackspolling loops.
Per-iteration progress logs are now emitted at trace level, and the one-shot "completed" log is now at debug level (previously info). This removes repeated info-level noise observed when callers wait for flushes or graceful close.
Deprecations
- `ZerobusSdk::create_stream()`: Use
sdk.stream_builder(table).oauth(id, secret).json().build().awaitinstead - `ZerobusSdk::create_stream_with_headers_provider()`: Use
sdk.stream_builder(table).headers_provider(p).json().build().awaitinstead - `ZerobusSdk::create_arrow_stream()`: Use
sdk.stream_builder(table).oauth(id, secret).arrow(schema).build_arrow().awaitinstead - `ZerobusSdk::create_arrow_stream_with_headers_provider()`: Use
sdk.stream_builder(table).headers_provider(p).arrow(schema).build_arrow().awaitinstead
API Changes
- New public exports:
ProxyConnector,ConnectorFactory,StreamBuilder. - New builder method:
ZerobusSdkBuilder::connector_factory. - New entry point:
ZerobusSdk::stream_builder(). - Changed
ZerobusSdkfieldsworkspace_idandtls_configtopub(crate)visibility (no public API impact).