diff --git a/CHANGELOG.md b/CHANGELOG.md index a3428d1..c0c6c2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ The envelope wire format is versioned separately by `meta.schema_version` ## [Unreleased] +## [1.3.1] - 2026-10-26 + +### Changed + +- The poison `dead_letter` block is now built by core `PoisonRecord.build(body, originalQueue, attempts, error, exception)` (babelqueue-core 1.14.0) instead of by hand; the DLQ record is byte-for-byte unchanged (`reason: "poison"`, `failed_at`, `lang: "java"`). + ## [1.3.0] - 2026-10-26 MINOR (ADR-0037 decision 1). The envelope stays at `schema_version: 1`. diff --git a/pom.xml b/pom.xml index 40dbe6d..cb60bbf 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.babelqueue babelqueue-pulsar - 1.3.0 + 1.3.1 jar BabelQueue Apache Pulsar @@ -49,7 +49,7 @@ 17 UTF-8 UTF-8 - 1.13.0 + 1.14.0 3.3.5 5.10.3 5.12.0 diff --git a/src/main/java/com/babelqueue/pulsar/PulsarConsumer.java b/src/main/java/com/babelqueue/pulsar/PulsarConsumer.java index d3ca2cb..8285d0f 100644 --- a/src/main/java/com/babelqueue/pulsar/PulsarConsumer.java +++ b/src/main/java/com/babelqueue/pulsar/PulsarConsumer.java @@ -4,7 +4,6 @@ import com.babelqueue.DeadLetters; import com.babelqueue.Envelope; import com.babelqueue.EnvelopeCodec; -import com.babelqueue.JsonValues; import com.babelqueue.PoisonRecord; import com.babelqueue.UnknownUrnException; import java.nio.ByteBuffer; @@ -312,15 +311,8 @@ private void routePoison(Message message, Envelope partial, byte[] body, } byte[] record; try { - Map block = new LinkedHashMap<>(); - block.put("reason", "poison"); - block.put("error", cause.getMessage()); - block.put("exception", cause.getClass().getName()); - block.put("failed_at", System.currentTimeMillis()); - block.put("original_queue", queueName(message)); - block.put("attempts", reconciled); - block.put("lang", EnvelopeCodec.SOURCE_LANG); - record = PoisonRecord.build(body, JsonValues.encode(block)).getBytes(StandardCharsets.UTF_8); + record = PoisonRecord.build(body, queueName(message), reconciled, cause.getMessage(), + cause.getClass().getName()).getBytes(StandardCharsets.UTF_8); } catch (RuntimeException error) { leaveUnsettled(message, partial, error); return;