feat: replace grpc with fibp binary protocol

Closed
VI
2mo ago
+2624-674

Summary

  • Migrates the Java SDK from gRPC/protobuf to the Fila binary protocol (FIBP), matching the server's removal of gRPC in Epic 20
  • Adds dev.faisca.fila.fibp codec package: Primitives (big-endian encoding), Opcodes, Codec (frame encoding for all 42 opcodes), FrameHeader, and Connection (TCP/TLS, handshake, multiplexed request/response, server-push delivery, ping/pong, continuation frame reassembly)
  • Rewrites FilaClient to use FIBP for all operations, adds admin ops (createQueue, deleteQueue, setConfig, getConfig, redrive) and auth ops (createApiKey, revokeApiKey, setAcl)
  • Removes all gRPC and protobuf dependencies — zero external runtime dependencies
  • Updates RpcException to use FIBP error codes instead of gRPC status codes
  • Version bump to 0.3.0
  • 40 tests passing: 27 unit + 13 integration (including TLS + API key auth)

Test plan

  • Unit tests: PrimitivesTest (11 round-trip tests for all encoding primitives)
  • Unit tests: BatchModeTest, EnqueueResultTest, BuilderTest (configuration validation)
  • Integration tests: FilaClientTest (enqueue/consume/ack lifecycle, nack redelivery, nonexistent queue error)
  • Integration tests: BatchClientTest (explicit batch, auto batching, linger batching, disabled batching, cross-queue batch errors)
  • Integration tests: TlsAuthClientTest (TLS + API key, rejection without API key)
  • Code formatting: spotlessApply passes

Summary by cubic

Replaced gRPC/protobuf with the Fila binary protocol (FIBP) in the Java SDK to remove external deps and add admin/auth features. Adds smart enqueue batching and addresses review feedback with stricter TLS builder checks and safer stream cancellation.

  • New Features

    • Added dev.faisca.fila.fibp codec: primitives, opcodes, frame encoding, and a TCP/TLS Connection with handshake, multiplexed req/resp, server-push delivery, ping/pong, and continuation reassembly.
    • Rewrote FilaClient to use FIBP for enqueue/consume/ack/nack; added admin ops (create/delete queue, set/get config, redrive) and auth ops (create/revoke API key, set ACL).
    • Added BatchMode, background Batcher, enqueueMany, per-item EnqueueResult; default opportunistic batching with linger and disabled options.
    • Updated RpcException to expose FIBP error codes; tightened builder validation (e.g., client cert/key require TLS) and improved consume cancellation handling.
    • 40 tests passing (27 unit, 13 integration incl. TLS + API key).
  • Migration

    • Removed io.grpc and com.google.protobuf dependencies and the Gradle protobuf plugin; zero external runtime deps.
    • Version bump to 0.3.0.
    • Error handling now uses FIBP error codes; use RpcException.getErrorCode() instead of gRPC status codes.