Skip to content

Commit c408b0d

Browse files
committed
Introduce BlockerBackPressureHandler marker interface (#1251)
1 parent a40821e commit c408b0d

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2013-2022 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package io.awspring.cloud.sqs.listener;
17+
18+
/**
19+
* Marker interface for a blocking {@link BackPressureHandler}. This handler is used to control the flow of messages in
20+
* a blocking manner. It is recommended to have at least one blocking back pressure handler in a
21+
* {@link CompositeBackPressureHandler} in order to enable more resource efficient polling.
22+
*/
23+
public interface BlockingBackPressureHandler extends BackPressureHandler {
24+
25+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @see PollingMessageSource
3232
*/
3333
public class ConcurrencyLimiterBlockingBackPressureHandler
34-
implements BatchAwareBackPressureHandler, IdentifiableContainerComponent {
34+
implements BlockingBackPressureHandler, BatchAwareBackPressureHandler, IdentifiableContainerComponent {
3535

3636
private static final Logger logger = LoggerFactory.getLogger(ConcurrencyLimiterBlockingBackPressureHandler.class);
3737

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
* @since 3.0
3232
* @see io.awspring.cloud.sqs.listener.source.PollingMessageSource
3333
*/
34-
public class SemaphoreBackPressureHandler implements BatchAwareBackPressureHandler, IdentifiableContainerComponent {
34+
public class SemaphoreBackPressureHandler
35+
implements BlockingBackPressureHandler, BatchAwareBackPressureHandler, IdentifiableContainerComponent {
3536

3637
private static final Logger logger = LoggerFactory.getLogger(SemaphoreBackPressureHandler.class);
3738

0 commit comments

Comments
 (0)