- The SDK now uses JNI (Java Native Interface) to call the Zerobus Rust SDK instead of pure Java gRPC calls
- Native library is automatically loaded from the classpath or system library path
- Token management and background processing handled by native code
ZerobusProtoStream - Protocol Buffer ingestion with method-level generics:
ingestRecordOffset(T record)- Auto-encoded: SDK encodes Message to bytesingestRecordOffset(byte[] bytes)- Pre-encoded: User provides encoded bytesingestRecordsOffset(List<T> records)- Batch auto-encoded ingestioningestRecordsOffset(List<byte[]> bytes)- Batch pre-encoded ingestiongetUnackedRecords()- ReturnsList<byte[]>of unacked recordsgetUnackedRecords(Parser<T>)- Returns parsedList<T>of unacked recordsgetUnackedBatches()- ReturnsList<EncodedBatch>preserving batch grouping
ZerobusJsonStream - JSON ingestion without Protocol Buffer dependency:
ingestRecordOffset(String json)- Pre-serialized: User provides JSON stringingestRecordOffset(T obj, JsonSerializer<T>)- Auto-serialized: SDK serializes objectingestRecordsOffset(List<String> jsons)- Batch pre-serialized ingestioningestRecordsOffset(List<T> objs, JsonSerializer<T>)- Batch auto-serialized ingestiongetUnackedRecords()- ReturnsList<String>of unacked JSON recordsgetUnackedRecords(JsonDeserializer<T>)- Returns parsedList<T>of unacked recordsgetUnackedBatches()- ReturnsList<EncodedBatch>preserving batch grouping
ZerobusSdk.createProtoStream(tableName, descriptorProto, clientId, clientSecret)- Create proto streamZerobusSdk.createProtoStream(tableName, descriptorProto, clientId, clientSecret, options)- With optionsZerobusSdk.createJsonStream(tableName, clientId, clientSecret)- Create JSON streamZerobusSdk.createJsonStream(tableName, clientId, clientSecret, options)- With optionsZerobusSdk.recreateStream(ZerobusProtoStream)- Recreate proto stream with unacked record re-ingestionZerobusSdk.recreateStream(ZerobusJsonStream)- Recreate JSON stream with unacked record re-ingestionZerobusSdk.recreateStream(ZerobusStream)- Recreate legacy stream (deprecated)
BaseZerobusStream- Abstract base class with native JNI methodsJsonSerializer<T>- Functional interface for object-to-JSON serializationJsonDeserializer<T>- Functional interface for JSON-to-object deserializationEncodedBatch- Represents a batch of encoded records for recoveryAckCallback- Callback interface withonAck(long)andonError(long, String)
ZerobusStream - Use ZerobusProtoStream instead:
ingestRecord(T record)- ReturnsCompletableFuture<Void>, useingestRecordOffset()insteadgetStreamId()- No longer exposed by native backend, returns empty stringgetState()- ReturnsOPENEDorCLOSEDonlygetUnackedRecords()- Breaking: Returns empty iterator (records stored in native, type erasure prevents deserialization). UseZerobusProtoStream.getUnackedRecords(Parser<T>)for typed access, or userecreateStream()which handles re-ingestion automatically using cached raw bytes.
StreamConfigurationOptions:
setAckCallback(Consumer<IngestRecordResponse>)- No longer invoked by native backend. UsesetAckCallback(AckCallback)instead
TokenFactory- Token management now handled by native Rust SDKBackgroundTask- Background processing now handled by native Rust SDKZerobusSdkStubUtils- gRPC stub utilities no longer needed with native backend
- Linux x86_64: Supported
- Windows x86_64: Supported
- macOS x86_64: Supported
- macOS aarch64 (Apple Silicon): Supported
Initial release of the Databricks Zerobus Ingest SDK for Java.
- Added
ZerobusSdkclass for creating ingestion streams - Added
ZerobusStreamclass for managing stateful gRPC streams - Added
RecordAcknowledgmentfor blocking until record acknowledgment - Added
TablePropertiesfor configuring table schema and name - Added
StreamConfigurationOptionsfor stream behavior configuration - Added
ZerobusExceptionandNonRetriableExceptionfor error handling - Added
StreamStateenum for tracking stream lifecycle - Added utility methods in
ZerobusSdkStubUtilsfor gRPC stub management - Support for Java 8 and higher