Skip to content

Commit 77488f1

Browse files
committed
Improve javadoc clarity
1 parent 9316ce3 commit 77488f1

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/BackPressureHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public interface BackPressureHandler {
4141
* Releases the specified amount of permits for processed messages. Each message that has been processed should
4242
* release one permit, whether processing was successful or not.
4343
* <p>
44-
* This method can is called in the following use cases:
44+
* This method can be called in the following use cases:
4545
* <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
4747
* limit and the difference in permits needs to be returned.</li>
4848
* <li>{@link ReleaseReason#NONE_FETCHED}: none of the permits were actually used because no messages were retrieved
4949
* from SQS. Permits need to be returned.</li>
@@ -82,16 +82,16 @@ default void release(int amount) {
8282

8383
enum ReleaseReason {
8484
/**
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.
8787
*/
8888
LIMITED,
8989
/**
9090
* No messages were retrieved from SQS, so all permits need to be returned.
9191
*/
9292
NONE_FETCHED,
9393
/**
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.
9595
*/
9696
PARTIAL_FETCH,
9797
/**

spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/BackPressureHandlerFactory.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
package io.awspring.cloud.sqs.listener;
1717

1818
/**
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.
2220
* <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.
2426
*/
2527
public interface BackPressureHandlerFactory {
2628

spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/ContainerOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ default BackOffPolicy getPollBackOffPolicy() {
130130
BackPressureMode getBackPressureMode();
131131

132132
/**
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.
134134
* @return the BackPressureHandlerFactory.
135135
*/
136136
BackPressureHandlerFactory getBackPressureHandlerFactory();

0 commit comments

Comments
 (0)