File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ public interface BackPressureHandler {
41
41
* Releases the specified amount of permits for processed messages. Each message that has been processed should
42
42
* release one permit, whether processing was successful or not.
43
43
* <p>
44
- * This method can is called in the following use cases:
44
+ * This method can be called in the following use cases:
45
45
* <ul>
46
- * <li>{@link ReleaseReason#LIMITED}: permits were not used because another BackPressureHandler has a lower permits
46
+ * <li>{@link ReleaseReason#LIMITED}: all/some permits were not used because another BackPressureHandler has a lower permits
47
47
* limit and the difference in permits needs to be returned.</li>
48
48
* <li>{@link ReleaseReason#NONE_FETCHED}: none of the permits were actually used because no messages were retrieved
49
49
* from SQS. Permits need to be returned.</li>
@@ -82,16 +82,16 @@ default void release(int amount) {
82
82
83
83
enum ReleaseReason {
84
84
/**
85
- * Permits were not used because another BackPressureHandler has a lower permits limit and the difference need
86
- * to be aligned across all handlers.
85
+ * All/Some permits were not used because another BackPressureHandler has a lower permits limit and the
86
+ * permits difference need to be aligned across all handlers.
87
87
*/
88
88
LIMITED ,
89
89
/**
90
90
* No messages were retrieved from SQS, so all permits need to be returned.
91
91
*/
92
92
NONE_FETCHED ,
93
93
/**
94
- * Some messages were fetched from SQS. Unused permits need to be returned.
94
+ * Some messages were fetched from SQS. Unused permits if any need to be returned.
95
95
*/
96
96
PARTIAL_FETCH ,
97
97
/**
Original file line number Diff line number Diff line change 16
16
package io .awspring .cloud .sqs .listener ;
17
17
18
18
/**
19
- * A factory for creating {@link BackPressureHandler} for managing queue consumption backpressure. Implementations can
20
- * configure each the {@link BackPressureHandler} according to its strategies, using the provided
21
- * {@link ContainerOptions}.
19
+ * Factory interface for creating {@link BackPressureHandler} instances to manage queue consumption backpressure.
22
20
* <p>
23
- * A set of default implementations are provided by the {@link BackPressureHandlerFactories} class.
21
+ * Implementations of this interface are responsible for producing a new {@link BackPressureHandler} for each
22
+ * container, configured according to the provided {@link ContainerOptions}. This ensures that internal resources
23
+ * (such as counters or semaphores) are not shared across containers, which could lead to unintended side effects.
24
+ * <p>
25
+ * Default factory implementations can be found in the {@link BackPressureHandlerFactories} class.
24
26
*/
25
27
public interface BackPressureHandlerFactory {
26
28
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ default BackOffPolicy getPollBackOffPolicy() {
130
130
BackPressureMode getBackPressureMode ();
131
131
132
132
/**
133
- * Return the a {@link BackPressureHandlerFactory} to create a {@link BackPressureHandler} for this container.
133
+ * Return the {@link BackPressureHandlerFactory} to create a {@link BackPressureHandler} for this container.
134
134
* @return the BackPressureHandlerFactory.
135
135
*/
136
136
BackPressureHandlerFactory getBackPressureHandlerFactory ();
You can’t perform that action at this time.
0 commit comments