You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docs: document partial acknowledgement failure handling in callbacks
- fix callback interface name to AsyncAcknowledgementResultCallback
- explain that onFailure receives SqsAcknowledgementException on partial failures
- add an example using successful/failed acknowledgement message lists for retry
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/sqs.adoc
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2020,7 +2020,7 @@ Implementations of this interface will be executed after an acknowledgement exec
2020
2020
2021
2021
==== Acknowledgement Result Callback
2022
2022
2023
-
The framework offers the `AcknowledgementResultCallback` and `AsyncAcknowledgementCallback` interfaces that can be added to a `SqsMessageListenerContainer` or `SqsMessageListenerContainerFactory`.
2023
+
The framework offers the `AcknowledgementResultCallback` and `AsyncAcknowledgementResultCallback` interfaces that can be added to a `SqsMessageListenerContainer` or `SqsMessageListenerContainerFactory`.
2024
2024
2025
2025
```java
2026
2026
public interface AcknowledgementResultCallback<T> {
@@ -2048,6 +2048,19 @@ public interface AsyncAcknowledgementResultCallback<T> {
2048
2048
}
2049
2049
```
2050
2050
2051
+
If an acknowledgement operation partially fails, for example when `DeleteMessageBatch` returns failed entries, the callback `onFailure` receives a `SqsAcknowledgementException`.
2052
+
Use `getSuccessfullyAcknowledgedMessages()` and `getFailedAcknowledgementMessages()` to inspect the acknowledgement result and retry only failed messages if needed.
2053
+
2054
+
```java
2055
+
@Override
2056
+
public void onFailure(Collection<Message<Object>> messages, Throwable t) {
2057
+
if (t instanceof SqsAcknowledgementException ex) {
0 commit comments