Configuration

The core is a codec, so there’s almost nothing to configure — the “wiring” is your own broker client plus a couple of optional behaviours.

Envelope options

EnvelopeCodec.make takes the queue name (written to meta.queue) and an optional inbound trace id to continue across a hop (pass null to mint a fresh one):

import com.babelqueue.*;
import java.util.Map;

Envelope env = EnvelopeCodec.make(
    "urn:babel:orders:created",
    Map.of("order_id", 1042L),
    "orders",
    null); // or inbound.traceId() to continue a trace

Dead-letter

On failure, wrap the envelope in an additive dead_letter block and publish the copy to your dead-letter queue (e.g. orders.dlq):

Envelope dlq = DeadLetters.annotate(env, "failed", "orders", 3, "boom", "java.lang.RuntimeException");
// publish EnvelopeCodec.encode(dlq) to the "orders.dlq" queue

DeadLetters.annotate returns a copy — the original envelope is preserved unchanged inside the dead-lettered message, so any-language consumer can still read it.

Unknown-URN strategy

For adapters routing inbound messages, UnknownUrnStrategy (FAIL, DELETE, RELEASE, DEAD_LETTER) describes what to do with a URN you don’t handle.

Next: Producing messages.