Package dk.cloudcreate.essentials.components.foundation.messaging.queue
package dk.cloudcreate.essentials.components.foundation.messaging.queue
-
ClassDescriptionDefaultDurableQueueConsumer<DURABLE_QUEUES extends DurableQueues,
UOW extends UnitOfWork, UOW_FACTORY extends UnitOfWorkFactory<UOW>> The defaultDurableQueueConsumerwhich provides basic implementation (including retrying messages in case of failure, polling interval optimization, etc.)
Log levels of interest:Represents a message queued onto a Durable QueueDurableQueuesconsumerNotification interface thatDurableQueueConsumercan implement if they want to be notified about messages being added to the queue they're consuming from
This is required forDurableQueueConsumer's that use aQueuePollingOptimizerTheDurableQueuesconcept supports intra-service point-to-point messaging using durable Queues that guarantee At-Least-Once delivery of messages.
The only requirement is that message producers and message consumers can access the same underlying durable Queue storage.The sorting order for theQueuedMessage.getId()Encapsulates a Message, which is aPairof Payload and itsMessageMetaDataEncapsulated Metadata (like headers, correlation id, tracing id's, etc.) associated with aMessageRepresents a message that will be delivered in order.
This of course requires that message are queued in order and that the consumer is single threaded.
All messages sharing the sameOrderedMessage.key, will be delivered according to theirOrderedMessage.order
An example of a message key is the id of the entity the message relates toPattern matchingQueuedMessageHandlerfor use withDurableQueues's
ThePatternMatchingQueuedMessageHandlerwill automatically call methods annotated with the @MessageHandler annotation and where the 1st argument matches the actual Message payload type (contained in theMessage.getPayload()provided to theQueuedMessageHandler.handle(QueuedMessage)method)Represents aMessagethat has been queued usingQueueMessage/QueueMessages/QueueMessageAsDeadLetterMessageThe unique entry for a message in a queue.The name of a Durable QueueOptimizer 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.TheQueuePollingOptimizer.SimpleQueuePollingOptimizersupports extending the polling sleep time (i.e.The transactional behaviour mode of aDurableQueues.