All Superinterfaces:
DurableQueueConsumerNotifications
All Known Implementing Classes:
QueuePollingOptimizer.SimpleQueuePollingOptimizer

public interface QueuePollingOptimizer extends DurableQueueConsumerNotifications
Optimizer designed to work together with the DefaultDurableQueueConsumer
The optimizer is responsible for optimizing the frequency by which the DefaultDurableQueueConsumer is polling the underlying database for new messages related to a given QueueName.
If a given Queue doesn't experience a high influx of message, or a lot of message's have (QueuedMessage.getNextDeliveryTimestamp()) that is further into the future, then it doesn't make sense to poll the database too often.
The QueuePollingOptimizer.SimpleQueuePollingOptimizer supports extending the polling sleep time (i.e. the time between calls to DurableQueues.getNextMessageReadyForDelivery(GetNextMessageReadyForDelivery)) up until a given threshold.
See Also:
  • Method Details

    • None

      static QueuePollingOptimizer None()
    • queuePollingReturnedNoMessages

      void queuePollingReturnedNoMessages()
    • queuePollingReturnedMessage

      void queuePollingReturnedMessage(QueuedMessage queuedMessage)
    • shouldSkipPolling

      boolean shouldSkipPolling()