From a2ad997c7d6211857f41449620654b3d366dfdb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammet=20=C5=9Eafak?= Date: Mon, 26 Oct 2026 16:44:00 +0300 Subject: [PATCH 1/2] refactor: build the poison dead_letter block via core PoisonRecord.build --- CHANGELOG.md | 4 ++++ pom.xml | 2 +- .../java/com/babelqueue/artemis/ArtemisConsumer.java | 12 +----------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f83440..c7b60c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ The envelope wire format is versioned separately by `meta.schema_version` ## [Unreleased] +### Changed + +- The poison DLQ block is built by `babelqueue-core` 1.14.0; no wire change. Requires `babelqueue-core` 1.14.0 (was 1.13.0). + ## [1.1.0] - 2026-10-26 MINOR (ADR-0037): poison bodies are dead-lettered as the ADR-0035 record and the version gate follows one diff --git a/pom.xml b/pom.xml index 6daabfe..97b5b12 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ 17 UTF-8 UTF-8 - 1.13.0 + 1.14.0 3.1.0 5.10.3 5.12.0 diff --git a/src/main/java/com/babelqueue/artemis/ArtemisConsumer.java b/src/main/java/com/babelqueue/artemis/ArtemisConsumer.java index 2fc07ef..3244463 100644 --- a/src/main/java/com/babelqueue/artemis/ArtemisConsumer.java +++ b/src/main/java/com/babelqueue/artemis/ArtemisConsumer.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 com.babelqueue.UnknownUrnStrategy; @@ -18,7 +17,6 @@ import jakarta.jms.TextMessage; import java.nio.charset.StandardCharsets; import java.util.HashMap; -import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; import java.util.function.BooleanSupplier; @@ -298,15 +296,7 @@ private void deadLetterPoison(Message message, Throwable cause) throws JMSExcept * {@code poison_dlq} case reaches it through {@link #poll()}, invalid UTF-8 as a {@code BytesMessage}). */ static String poisonRecord(byte[] body, String originalQueue, int attempts, Throwable cause) { - 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", originalQueue); - block.put("attempts", attempts); - block.put("lang", EnvelopeCodec.SOURCE_LANG); - return PoisonRecord.build(body, JsonValues.encode(block)); + return PoisonRecord.build(body, originalQueue, attempts, cause.getMessage(), cause.getClass().getName()); } /** The consumed queue's name: the message's JMS destination, else the DLQ name without its {@code .dlq} suffix. */ From e59973e59a8644be8b20c5876e8ae2451f21938d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammet=20=C5=9Eafak?= Date: Mon, 26 Oct 2026 17:37:56 +0300 Subject: [PATCH 2/2] Release v1.1.1 --- CHANGELOG.md | 2 ++ pom.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7b60c8..55a9318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ The envelope wire format is versioned separately by `meta.schema_version` ## [Unreleased] +## [1.1.1] - 2026-10-26 + ### Changed - The poison DLQ block is built by `babelqueue-core` 1.14.0; no wire change. Requires `babelqueue-core` 1.14.0 (was 1.13.0). diff --git a/pom.xml b/pom.xml index 97b5b12..a300e94 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.babelqueue babelqueue-artemis - 1.1.0 + 1.1.1 jar BabelQueue Apache ActiveMQ Artemis