Interface OutboxTransport

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface OutboxTransport
The minimal publish-only broker seam the OutboxRelay forwards through — publish one already-encoded envelope onto a queue. It is the byte-typed counterpart of the core's existing transport surfaces (Redrive.Transport.publish(queue, body) and the otel.Sender): the core is codec-only, so an adapter implements this over its broker (babelqueue-java-sqs, babelqueue-java-redis, babelqueue-spring, or a plain client).

The relay hands this method the stored bytes verbatim — the exact EnvelopeCodec.encode(com.babelqueue.Envelope) output that Outbox.write(com.babelqueue.Envelope) persisted (GR-1): the body is never decoded, rebuilt or re-encoded, so trace_id survives end-to-end (GR-4) and the bytes that reach the broker are byte-identical to what was stored (GR-5). It is a single-method FunctionalInterface so a caller can supply a lambda over their own client.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    publish(String queue, byte[] body)
    Publish a raw, already-encoded (UTF-8 JSON) envelope onto a queue.
  • Method Details

    • publish

      void publish(String queue, byte[] body) throws Exception
      Publish a raw, already-encoded (UTF-8 JSON) envelope onto a queue. The body is the verbatim bytes the outbox stored; do not decode or mutate them.
      Parameters:
      queue - the logical queue to publish to
      body - the frozen, encoded envelope bytes, byte-for-byte as stored
      Throws:
      Exception - to signal a failed publish; the relay catches it, records it via OutboxStore.markFailed(String, String) and leaves the row pending