Skip to content

feat: 30.2 — unified api surface#4

Merged
vieiralucas merged 2 commits intomainfrom
feat/30.2-unified-api
Mar 25, 2026
Merged

feat: 30.2 — unified api surface#4
vieiralucas merged 2 commits intomainfrom
feat/30.2-unified-api

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Mar 25, 2026

Summary

  • Update Java SDK for the unified API from Story 30.1
  • BatchEnqueue RPC removed; Enqueue now accepts repeated EnqueueMessage
  • Ack/Nack now accept repeated AckMessage/NackMessage with per-item typed results
  • ConsumeResponse uses only repeated Message messages (singular message field removed)
  • batchEnqueue() replaced by enqueueMany() (no "batch" prefix)
  • BatchEnqueueResult renamed to EnqueueResult
  • Batcher updated to use unified Enqueue RPC for all batch sizes
  • All tests updated and passing (34/34 pass; 1 pre-existing TLS env failure)

Test plan

  • Unit tests: EnqueueResultTest, BatchModeTest, BuilderTest all pass
  • Integration tests: FilaClientTest (enqueue/consume/ack/nack lifecycle) passes
  • Integration tests: BatchClientTest (enqueueMany, auto/linger/disabled batching) passes
  • Verified TLS test failure is pre-existing (fails on main too)

Summary by cubic

Unifies the Java SDK and proto around a single enqueue/ack/nack API with per-item results and typed errors, removing the BatchEnqueue RPC. Adds StreamEnqueue, simplifies ConsumeResponse to messages[], renames client batch APIs to enqueueMany, and routes the batcher through the unified Enqueue.

  • Bug Fixes

    • ack()/nack() now validate exactly one per-item result and require explicit success; empty or unset results throw.
  • Migration

    • Replace FilaClient.batchEnqueue(...) with FilaClient.enqueueMany(...); use EnqueueResult (was BatchEnqueueResult).
    • Protos: remove BatchEnqueue; use EnqueueRequest.messages[], AckRequest.messages[], NackRequest.messages[]; read ConsumeResponse.messages[] only.
    • Handle typed errors: EnqueueError, AckError, NackError.

Written for commit 33358e2. Summary will update on new commits.

- Copy new service.proto: BatchEnqueue RPC removed, Enqueue now takes
  repeated EnqueueMessage, Ack/Nack take repeated messages with
  per-item results, ConsumeResponse uses only repeated messages field
- Rename BatchEnqueueResult to EnqueueResult (no "batch" prefix)
- Replace batchEnqueue() with enqueueMany() on FilaClient
- Update enqueue() to wrap single message in repeated EnqueueMessage
- Update ack()/nack() to wrap in repeated, parse first result with
  typed error handling (AckError/NackError)
- Update Batcher to use unified Enqueue RPC for all batch sizes
- Update consumeStream() to use only getMessagesList() (no singular
  message fallback)
- Update all tests to use new API names and types
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/main/java/dev/faisca/fila/FilaClient.java">

<violation number="1" location="src/main/java/dev/faisca/fila/FilaClient.java:222">
P2: `ack()` treats missing/unset per-item results as success. Validate that exactly one result is returned and that it is an explicit success case.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

ack() and nack() silently treated empty results and RESULT_NOT_SET as
success. Now both methods validate exactly one result is returned and
that it is an explicit success case, matching the pattern in
enqueueDirect().
@vieiralucas vieiralucas merged commit 1c2e12c into main Mar 25, 2026
2 checks passed
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