Interface BatchAwareBackPressureHandler

All Superinterfaces:
BackPressureHandler
All Known Implementing Classes:
CompositeBackPressureHandler, ConcurrencyLimiterBlockingBackPressureHandler, FullBatchBackPressureHandler, SemaphoreBackPressureHandler

public interface BatchAwareBackPressureHandler extends BackPressureHandler
BackPressureHandler specialization that allows requesting batches.
Since:
3.0
Author:
Tomaz Fernandes, Loïc Rouchon
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.awspring.cloud.sqs.listener.backpressure.BackPressureHandler

    BackPressureHandler.ReleaseReason
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Deprecated.
    This method is deprecated and will not be used by the Spring Cloud AWS SQS listener anymore.
    default void
    Releases the specified amount of permits for processed messages.
    default void
    Deprecated.
    This method is deprecated and will not be called by the Spring Cloud AWS SQS listener anymore.
    int
    Request a batch of permits.

    Methods inherited from interface io.awspring.cloud.sqs.listener.backpressure.BackPressureHandler

    drain, release, request
  • Method Details

    • requestBatch

      int requestBatch() throws InterruptedException
      Request a batch of permits.
      Returns:
      the number of permits acquired.
      Throws:
      InterruptedException - if the Thread is interrupted while waiting for permits.
    • releaseBatch

      @Deprecated default void releaseBatch()
      Deprecated.
      This method is deprecated and will not be called by the Spring Cloud AWS SQS listener anymore. Implement BackPressureHandler.release(int, ReleaseReason) instead.
      Release a batch of permits. This has the semantics of letting the BackPressureHandler know that all permits from a batch are being released, in opposition to BackPressureHandler.release(int) in which any number of permits can be specified.
    • release

      default void release(int amount, BackPressureHandler.ReleaseReason reason)
      Description copied from interface: BackPressureHandler
      Releases the specified amount of permits for processed messages. Each message that has been processed should release one permit, whether processing was successful or not.

      This method can be called in the following use cases:

      Specified by:
      release in interface BackPressureHandler
      Parameters:
      amount - the amount of permits to release.
      reason - the reason why the permits were released.
    • getBatchSize

      @Deprecated default int getBatchSize()
      Deprecated.
      This method is deprecated and will not be used by the Spring Cloud AWS SQS listener anymore.
      Return the configured batch size for this handler.
      Returns:
      the batch size.