Interface QueuePollingOptimizer
-
- All Superinterfaces:
DurableQueueConsumerNotifications
- All Known Implementing Classes:
QueuePollingOptimizer.SimpleQueuePollingOptimizer
public interface QueuePollingOptimizer extends DurableQueueConsumerNotifications
Optimizer designed to work together with theDefaultDurableQueueConsumer
The optimizer is responsible for optimizing the frequency by which theDefaultDurableQueueConsumeris polling the underlying database for new messages related to a givenQueueName.
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.
TheQueuePollingOptimizer.SimpleQueuePollingOptimizersupports extending the polling sleep time (i.e. the time between calls toDurableQueues.getNextMessageReadyForDelivery(GetNextMessageReadyForDelivery)) up until a given threshold.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classQueuePollingOptimizer.SimpleQueuePollingOptimizerTheQueuePollingOptimizer.SimpleQueuePollingOptimizersupports extending the polling sleep time (i.e.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static QueuePollingOptimizerNone()voidqueuePollingReturnedMessage(QueuedMessage queuedMessage)voidqueuePollingReturnedNoMessages()booleanshouldSkipPolling()-
Methods inherited from interface dk.cloudcreate.essentials.components.foundation.messaging.queue.DurableQueueConsumerNotifications
messageAdded
-
-
-
-
Method Detail
-
None
static QueuePollingOptimizer None()
-
queuePollingReturnedNoMessages
void queuePollingReturnedNoMessages()
-
queuePollingReturnedMessage
void queuePollingReturnedMessage(QueuedMessage queuedMessage)
-
shouldSkipPolling
boolean shouldSkipPolling()
-
-