Kafka binder skips failed input records when DLQ publication fails
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java, kafka, spring, spring-boot
- Lĩnh vực
- backend-api-design, distributed-systems
Hướng nghiên cứu
Start with DlqSender.sendToDlq() in binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/java/org/springframework/cloud/stream/binder/kafka/KafkaMessageChannelBinder.java and trace its send failure handling and manual acknowledgment. Reproduce the reported case with the embedded Kafka integration test setup; done means a failed DLQ send leaves the input offset eligible for redelivery while successful DLQ publication retains the expected behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the issue
With enableDlq=true, the Kafka binder swallows DLQ publication failures and allows the input offset to be committed, even though neither processing nor DLQ publication succeeded.
The issue also occurs with dlqProducerProperties.sync: true; synchronous publication does not prevent it.
To Reproduce
- Configure a non-batch Kafka consumer with:
- An explicit consumer group.
enableDlq: trueand a configureddlqName.dlqProducerProperties.sync: true.ackMode: RECORD.
- Make processing throw an exception.
- Force DLQ publication to fail—for example, configure a DLQ value serializer that throws
SerializationException. - Publish a record and wait for processing retries to be exhausted.
- Observe
Error sending to DLQbeing logged, but the consumer group's committed offset advancing past the failed record. - Publish another record to the same partition and observe that consumption continues.
Versions of the framework
- Spring Boot: 4.2.0
- Spring Cloud: 2026.0.0
- Spring Cloud Stream Kafka binder: 5.1.0
- Spring Kafka: 4.2.0
Expected behavior
A failed DLQ publication should not count as successful recovery. The input record should remain eligible for redelivery rather than having its offset committed.
Verification performed
An embedded-Kafka integration test confirmed through Kafka's Admin API that:
- The failed record's offset was committed before any subsequent record was published.
- The DLQ remained empty.
- Subsequent records were consumed.
An external-cluster test also demonstrated the DLQ failure followed by continued consumption and a commit attempt past the failed record.
Additional context
In DlqSender.sendToDlq(), the binder waits for the send result, but catches publication exceptions and only logs them without rethrowing.
Additionally, manual acknowledgment occurs in finally, regardless of publication success.
This report concerns the non-transactional Kafka binder with enableDlq, not the Kafka Streams binder.
- Ngôn ngữ chính
- Java
- Star
- 1.1k
- Fork
- 657
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của spring-cloud/spring-cloud-stream
-
Move the spring-cloud-commons version and BOM import from the bus parent to the stream parentCó thể đã có người làm @olegz đã nhận hôm nay. Đang mởtask
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
spring-cloud/spring-cloud-stream#3355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Clarify support for manual ack/nack with batch mode + DLQ; potential bug in acknowledge(index) pathĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
spring-cloud/spring-cloud-stream#3189 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add RecordInterceptor support for Kafka Streams binderCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
spring-cloud/spring-cloud-stream#3188 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
task
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
spring-cloud/spring-cloud-stream#3187 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
spring-cloud/spring-cloud-stream#3177 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của spring-cloud/spring-cloud-stream
Issue tương tự
-
enhancement infra
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
5.0.x backport bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
spring-cloud/spring-cloud-function#1569 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
NoSuchMethodError in the circuit breaker since 3.103.0 when resilience4j 2.x is on the classpathĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
oracle/oci-java-sdk#803 ·
-
area:cpan-port area:performance bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#2230 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100