Class BackPressureHandlerFactories

java.lang.Object
io.awspring.cloud.sqs.listener.backpressure.BackPressureHandlerFactories

public class BackPressureHandlerFactories extends Object
Utility class for creating BackPressureHandlerFactory instances used to apply back pressure strategies in SQS listener containers.

The factories provided by this class can be passed to ContainerOptions during container configuration.

Example usage:


 factory.configure(options -> options.maxConcurrentMessages(100).maxDelayBetweenPolls(Duration.ofSeconds(1))
 		.maxMessagesPerPoll(8)
 		.backPressureHandlerFactory(BackPressureHandlerFactories.concurrencyLimiterBackPressureHandler()));
 

The BackPressureMode setting in ContainerOptions is only used when using adaptiveThroughputBackPressureHandler(). If you're passing a specific factory such as concurrencyLimiterBackPressureHandler(), the mode will be ignored.

The following ContainerOptions properties are used by the built-in back pressure handler implementations:

For advanced scenarios, multiple handlers can be combined using compositeBackPressureHandler(List) or compositeBackPressureHandler(BackPressureHandlerFactory...).

Since:
4.0.0
Author:
Loïc Rouchon, Tomaz Fernandes