Skip to content

Commit 2b32e50

Browse files
authored
Add new response type for SQSaaES Partial Batch Feature (#279)
Added a new response type to return the list of failed messages.
1 parent cb0b363 commit 2b32e50

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5+
* the License. A copy of the License is located at
6+
*
7+
* http://aws.amazon.com/apache2.0
8+
*
9+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11+
* and limitations under the License.
12+
*/
13+
14+
package com.amazonaws.services.lambda.runtime.events;
15+
16+
import lombok.AllArgsConstructor;
17+
import lombok.Builder;
18+
import lombok.Data;
19+
import lombok.NoArgsConstructor;
20+
21+
import java.io.Serializable;
22+
import java.util.List;
23+
24+
/**
25+
* Function response type to report batch item failures for {@link SQSEvent}.
26+
*/
27+
@Data
28+
@NoArgsConstructor
29+
@AllArgsConstructor
30+
@Builder(setterPrefix = "with")
31+
public class SQSBatchResponse implements Serializable {
32+
33+
private static final long serialVersionUID = 5075170615239078773L;
34+
35+
/**
36+
* A list of messageIds that failed processing. These messageIds will be retried.
37+
*/
38+
private List<BatchItemFailure> batchItemFailures;
39+
40+
@Data
41+
@NoArgsConstructor
42+
@AllArgsConstructor
43+
@Builder(setterPrefix = "with")
44+
public static class BatchItemFailure implements Serializable {
45+
46+
private static final long serialVersionUID = 40727862494377907L;
47+
48+
/**
49+
* MessageId that failed processing
50+
*/
51+
String itemIdentifier;
52+
}
53+
}

0 commit comments

Comments
 (0)