|
17 | 17 |
|
18 | 18 | import io.awspring.cloud.autoconfigure.AwsClientProperties;
|
19 | 19 | import io.awspring.cloud.sqs.listener.QueueNotFoundStrategy;
|
20 |
| -import java.time.Duration; |
21 | 20 | import org.springframework.boot.context.properties.ConfigurationProperties;
|
22 | 21 | import org.springframework.lang.Nullable;
|
| 22 | +import software.amazon.awssdk.services.sqs.model.MessageSystemAttributeName; |
| 23 | + |
| 24 | +import java.time.Duration; |
| 25 | +import java.util.List; |
23 | 26 |
|
24 | 27 | /**
|
25 | 28 | * Properties related to AWS SQS.
|
@@ -79,8 +82,9 @@ public void setObservationEnabled(Boolean observationEnabled) {
|
79 | 82 | public static class Listener {
|
80 | 83 |
|
81 | 84 | /**
|
82 |
| - * The maximum concurrent messages that can be processed simultaneously for each queue. Note that if |
83 |
| - * acknowledgement batching is being used, the actual maximum number of messages inflight might be higher. |
| 85 | + * The maximum concurrent messages that can be processed simultaneously for each |
| 86 | + * queue. Note that if acknowledgement batching is being used, the actual maximum |
| 87 | + * number of messages inflight might be higher. |
84 | 88 | */
|
85 | 89 | @Nullable
|
86 | 90 | private Integer maxConcurrentMessages;
|
@@ -138,6 +142,93 @@ public Duration getMaxDelayBetweenPolls() {
|
138 | 142 | public void setMaxDelayBetweenPolls(Duration maxDelayBetweenPolls) {
|
139 | 143 | this.maxDelayBetweenPolls = maxDelayBetweenPolls;
|
140 | 144 | }
|
| 145 | + |
| 146 | + } |
| 147 | + |
| 148 | + public static class Batch { |
| 149 | + |
| 150 | + /** |
| 151 | + * The maximum number of messages that can be processed in a single batch. The |
| 152 | + * maximum is 10. |
| 153 | + */ |
| 154 | + private Integer maxNumberOfMessages; |
| 155 | + |
| 156 | + /** |
| 157 | + * The frequency at which requests are sent to SQS when processing messages in a |
| 158 | + * batch. |
| 159 | + */ |
| 160 | + private Duration sendBatchFrequency; |
| 161 | + |
| 162 | + /** |
| 163 | + * The visibility timeout to set for messages received in a batch. If unset, the |
| 164 | + * queue default is used. |
| 165 | + */ |
| 166 | + private Duration visibilityTimeout; |
| 167 | + |
| 168 | + /** |
| 169 | + * The minimum wait duration for a receiveMessage request in a batch. To avoid |
| 170 | + * unnecessary CPU usage, do not set this value to 0. |
| 171 | + */ |
| 172 | + private Duration waitTimeSeconds; |
| 173 | + |
| 174 | + /** |
| 175 | + * The list of system attribute names to request for receiveMessage calls. |
| 176 | + */ |
| 177 | + private List<MessageSystemAttributeName> systemAttributeNames; |
| 178 | + |
| 179 | + /** |
| 180 | + * The list of attribute names to request for receiveMessage calls. |
| 181 | + */ |
| 182 | + private List<String> attributeNames; |
| 183 | + |
| 184 | + public Integer getMaxNumberOfMessages() { |
| 185 | + return maxNumberOfMessages; |
| 186 | + } |
| 187 | + |
| 188 | + public void setMaxNumberOfMessages(Integer maxNumberOfMessages) { |
| 189 | + this.maxNumberOfMessages = maxNumberOfMessages; |
| 190 | + } |
| 191 | + |
| 192 | + public Duration getSendBatchFrequency() { |
| 193 | + return sendBatchFrequency; |
| 194 | + } |
| 195 | + |
| 196 | + public void setSendBatchFrequency(Duration sendBatchFrequency) { |
| 197 | + this.sendBatchFrequency = sendBatchFrequency; |
| 198 | + } |
| 199 | + |
| 200 | + public Duration getVisibilityTimeout() { |
| 201 | + return visibilityTimeout; |
| 202 | + } |
| 203 | + |
| 204 | + public void setVisibilityTimeout(Duration visibilityTimeout) { |
| 205 | + this.visibilityTimeout = visibilityTimeout; |
| 206 | + } |
| 207 | + |
| 208 | + public Duration getWaitTimeSeconds() { |
| 209 | + return waitTimeSeconds; |
| 210 | + } |
| 211 | + |
| 212 | + public void setWaitTimeSeconds(Duration waitTimeSeconds) { |
| 213 | + this.waitTimeSeconds = waitTimeSeconds; |
| 214 | + } |
| 215 | + |
| 216 | + public List<MessageSystemAttributeName> getSystemAttributeNames() { |
| 217 | + return systemAttributeNames; |
| 218 | + } |
| 219 | + |
| 220 | + public void setSystemAttributeNames(List<MessageSystemAttributeName> systemAttributeNames) { |
| 221 | + this.systemAttributeNames = systemAttributeNames; |
| 222 | + } |
| 223 | + |
| 224 | + public List<String> getAttributeNames() { |
| 225 | + return attributeNames; |
| 226 | + } |
| 227 | + |
| 228 | + public void setAttributeNames(List<String> attributeNames) { |
| 229 | + this.attributeNames = attributeNames; |
| 230 | + } |
| 231 | + |
141 | 232 | }
|
142 | 233 |
|
143 | 234 | }
|
0 commit comments