Package io.awspring.cloud.sqs.listener
Interface BatchAwareBackPressureHandler
- All Superinterfaces:
BackPressureHandler
- All Known Implementing Classes:
SemaphoreBackPressureHandler
BackPressureHandler specialization that allows requesting and releasing batches. Batch size should be
configured by the implementations.- Since:
- 3.0
- Author:
- Tomaz Fernandes
-
Method Summary
Modifier and TypeMethodDescriptionintReturn the configured batch size for this handler.voidRelease a batch of permits.intRequest a batch of permits.Methods inherited from interface io.awspring.cloud.sqs.listener.BackPressureHandler
drain, release, request
-
Method Details
-
requestBatch
Request a batch of permits.- Returns:
- the number of permits acquired.
- Throws:
InterruptedException- if the Thread is interrupted while waiting for permits.
-
releaseBatch
void releaseBatch()Release a batch of permits. This has the semantics of letting theBackPressureHandlerknow that all permits from a batch are being released, in opposition toBackPressureHandler.release(int)in which any number of permits can be specified. -
getBatchSize
int getBatchSize()Return the configured batch size for this handler.- Returns:
- the batch size.
-