From 7a20ece1c7392722d9f2a36f88ec85b0f7be7704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammet=20=C5=9Eafak?= Date: Mon, 26 Oct 2026 16:44:01 +0300 Subject: [PATCH 1/2] refactor: build the poison dead_letter block via core PoisonRecord.build --- CHANGELOG.md | 4 ++++ pom.xml | 2 +- src/main/java/com/babelqueue/sqs/SqsConsumer.java | 12 +----------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 661589d..8c0a243 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.4.0] - 2026-10-26 MINOR (ADR-0037): the consumer gains an opt-in BabelQueue DLQ and settles poison bodies and version-gated diff --git a/pom.xml b/pom.xml index b87c0af..ecffdbd 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ 17 UTF-8 UTF-8 - 1.13.0 + 1.14.0 2.25.0 1.45.0 6.1.3 diff --git a/src/main/java/com/babelqueue/sqs/SqsConsumer.java b/src/main/java/com/babelqueue/sqs/SqsConsumer.java index 9a821b8..d6bb360 100644 --- a/src/main/java/com/babelqueue/sqs/SqsConsumer.java +++ b/src/main/java/com/babelqueue/sqs/SqsConsumer.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; @@ -13,7 +12,6 @@ import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.HexFormat; -import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -272,15 +270,7 @@ record = poisonRecord(body.getBytes(StandardCharsets.UTF_8), SqsQueues.nameFromU * {@code poison_dlq} drives it directly for bodies SQS itself cannot carry, such as invalid UTF-8). */ 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()); } /** {@code ApproximateReceiveCount - 1} (informational {@code dead_letter.attempts}), never negative. */ From 500afc415ac2426562eadb143b8ebc97ad02a038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammet=20=C5=9Eafak?= Date: Mon, 26 Oct 2026 17:37:57 +0300 Subject: [PATCH 2/2] Release v1.4.1 --- CHANGELOG.md | 2 ++ pom.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c0a243..30864d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ The envelope wire format is versioned separately by `meta.schema_version` ## [Unreleased] +## [1.4.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 ecffdbd..44e9bea 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.babelqueue babelqueue-sqs - 1.4.0 + 1.4.1 jar BabelQueue Amazon SQS