Skip to content

[Java] Various improvements and fixes#156

Open
danilonajkov-db wants to merge 7 commits intomainfrom
java-fixes
Open

[Java] Various improvements and fixes#156
danilonajkov-db wants to merge 7 commits intomainfrom
java-fixes

Conversation

@danilonajkov-db
Copy link
Contributor

What changes are proposed in this pull request?

This PR contains various improvements and fixes:

  1. The JNI nativeClose used .take() which destroyed the Rust stream object, making nativeGetUnackedBatches/nativeGetUnackedRecords always fail afterward. The Java side silently swallowed the error and returned empty lists.
    • Changed nativeClose in both stream.rs and arrow_stream.rs to use .as_mut() (close in place) so the stream stays accessible.
  2. Builder validation: Reject negative values for timeouts/backoff/retries and zero/negative for max inflight counts in ArrowStreamConfigurationOptions and StreamConfigurationOptions
  3. Null checks on ingestion: Validate record, encodedBytes, json, serializer params in ZerobusProtoStream and ZerobusJsonStream
  4. Validate constructor and create*Stream() arguments
  5. Deleted unused nativeGetTableName from ZerobusArrowStream
  6. getClientId()/getClientSecret() on ZerobusArrowStream now public

How is this tested?

  • 14 new unit tests
  • 2 new integration tests verifying getUnackedBatches/getUnackedRecords work after close()

@danilonajkov-db danilonajkov-db marked this pull request as ready for review March 23, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant