All Classes and Interfaces

Class
Description
Mark the message as acknowledged - this operation also deletes the messages from the Queue
Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
Operation also matches DurableQueuesInterceptor.intercept(AcknowledgeMessageAsHandled, InterceptorChain)
Version of UnitOfWork that's aware of the ClientSession associated with the current UnitOfWork
Will likely be removed in the future as having access to the ClientSession doesn't seem to be needed
Start an asynchronous message consumer.
Note: There can only be one DurableQueueConsumer per QueueName per DurableQueues instance Operation also matches DurableQueuesInterceptor.intercept(ConsumeFromQueue, InterceptorChain)
Builder for ConsumeFromQueue
Base class for implementing persistent/durable FencedLockManager's
Common super base class for implementing persistent/durable FencedLockManager's
The default DurableQueueConsumer which provides basic implementation (including retrying messages in case of failure, polling interval optimization, etc.)
Log levels of interest:
Default LifecycleManager that integrate with Spring to ensure that ApplicationContext Beans that registered Beans implementing the Lifecycle interface are started and stopped
Represents a message queued onto a Durable Queue
Delete a message (Queued or Dead Letter Message)
Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
Operation also matches DurableQueuesInterceptor.intercept(DeleteMessage, InterceptorChain)
Builder for DeleteMessage
Provides a JVM local and durable, in regard to DurableLocalCommandBus.sendAndDontWait(Object)/DurableLocalCommandBus.sendAndDontWait(Object, Duration)), variant of the CommandBus concept
Durability for DurableLocalCommandBus.sendAndDontWait(Object)/DurableLocalCommandBus.sendAndDontWait(Object, Duration)) is delegated to DurableQueues
Which QueueName that is used will be determined by the specified DurableLocalCommandBus.getCommandQueueName()
The RedeliveryPolicy is determined by the specified DurableLocalCommandBus.getCommandQueueRedeliveryPolicy()

Note: If the SendAndDontWaitErrorHandler provided doesn't rethrow the exception, then the underlying DurableQueues will not be able to retry the command.
Due to this the DurableLocalCommandBus defaults to using the SendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandler
DurableQueues consumer
Notification interface that DurableQueueConsumer can implement if they want to be notified about messages being added to the queue they're consuming from
This is required for DurableQueueConsumer's that use a QueuePollingOptimizer
 
The DurableQueues concept 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 the QueuedMessage.getId()
 
 
 
Builder for RedeliveryPolicy that allows for defining an Exponential Backoff strategy - similar to RedeliveryPolicyBuilder
Represents a named fenced lock, where the FencedLock.getCurrentToken() can be passed on to down stream logic, which can keep track of the token value to identify if a timed out lock is being used to request logic.
The fence locking concept is described here https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html
 
Is published on the LocalEventBus when a Lifecycle.start() is called (and the lock manager isn't already started)
Is published on the LocalEventBus when a Lifecycle.stop() is called (and the lock manager isn't already stopped)
 
 
 
This library provides a Distributed Locking Manager based of the Fenced Locking concept described here

The FencedLockManager is responsible for obtaining and managing distributed FencedLock's, which are named exclusive locks.
Only one FencedLockManager instance can acquire a FencedLock at a time.
The implementation has been on supporting intra-service (i.e. across different deployed instances of the same service) Lock support through database based implementations (MongoFencedLockManager and PostgresqlFencedLockManager).
In a service oriented architecture it's common for all deployed instances of a given service (e.g. a Sales service) to share the same underlying database(s).
 
A builder for defining a RedeliveryPolicy with a Fixed Backoff strategy
Generic HandleAwareUnitOfWorkFactory variant where the implementation manually manages the UnitOfWork and the underlying database Transaction.
This class is built for inheritance, but can also be used directly - e.g. through the JdbiUnitOfWorkFactory

If you e.g. need to have a UnitOfWork join in with an existing Spring Managed transaction then please use the Spring specific UnitOfWorkFactory, SpringManagedUnitOfWorkFactory, provided with the spring-postgresql-event-store module.
 
Query Dead Letter Messages (i.e. not normal Queued Messages) for the given Queue
Operation also matched DurableQueuesInterceptor.intercept(GetDeadLetterMessages, InterceptorChain)
Query the next Queued Message (i.e. not including Dead Letter Messages) that's ready to be delivered to a DurableQueueConsumer
Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
Operation also matched DurableQueuesInterceptor.intercept(GetNextMessageReadyForDelivery, InterceptorChain)
Builder for GetQueuedMessage
Get the total number of (non-dead-letter) messages queued and number of queued dead-letter Messages for the given queue
Operation also matched DurableQueuesInterceptor.intercept(GetQueuedMessageCountsFor, InterceptorChain)
Query Queued Messages (i.e. not including Dead Letter Messages) for the given Queue
Operation also matched DurableQueuesInterceptor.intercept(GetQueuedMessages, InterceptorChain)
Builder for GetQueuedMessages
Get the total number of dead-letter-messages/poison-messages queued for the given queue
Operation also matched DurableQueuesInterceptor.intercept(GetTotalDeadLetterMessagesQueuedFor, InterceptorChain)
Get the total number of messages queued (i.e. not including Dead Letter Messages) for the given queue
Operation also matched DurableQueuesInterceptor.intercept(GetTotalMessagesQueuedFor, InterceptorChain)
Version of UnitOfWork that's aware of the Handle associated with the current UnitOfWork
Specialization of UnitOfWorkFactory that created and maintains HandleAwareUnitOfWork's
The Inbox supports the transactional Store and Forward pattern from Enterprise Integration Patterns supporting At-Least-Once delivery guarantee.
The Inbox pattern is used to handle incoming messages from a message infrastructure (such as a Queue, Kafka, EventBus, etc).
 
 
The Inbox supports the transactional Store and Forward pattern from Enterprise Integration Patterns supporting At-Least-Once delivery guarantee.
The Inbox pattern is used to handle incoming messages from a message infrastructure (such as a Queue, Kafka, EventBus, etc.).
Inboxes variant that uses DurableQueues as the underlying implementation.
ONLY in cases where the underlying DurableQueues is associated with a UnitOfWorkFactory will the Inbox message consumption be performed within UnitOfWork, otherwise message consumption isn't performed with a UnitOfWork
The name of an Inbox
Thrown by checkIsValidCollectionName(String) in case the rules are violated
Thrown by PostgresqlUtil.checkIsValidTableOrColumnName(String) in case a table or column name is null, empty, matches a reserved keyword, or contains invalid characters.
 
Helper class to resolve IO, Connection, Transaction, Socket exception
Jackson ObjectMapper based JSONSerializer
 
 
 
JSON serializer and deserializer
Common process life cycle interface - backwards compatible variant of dk.cloudcreate.essentials.shared.Lifecycle
Interface that controls start and stopping of life cycle beeans
A builder for defining a RedeliveryPolicy with a Linear Backoff strategy
Helper class for setting up the NOTIFY part of the classical Postgresql LISTEN/NOTIFY concept.
See Listen Notify and
SQL Notify Security It is the responsibility of the user of this component to sanitize any table or column names provided to methods in this class to ensure the security of all the SQL statements generated by this component.
 
 
 
Contains the name of a FencedLock
Mark an already Queued Message as a Dead Letter Message (or Poison Message).
Dead Letter Messages won't be delivered to any DurableQueueConsumer (called by the DurableQueueConsumer)
To deliver a Dead Letter Message you must first resurrect the message using DurableQueues.resurrectDeadLetterMessage(QueueEntryId, Duration)
Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
Operation also matches DurableQueuesInterceptor.intercept(MarkAsDeadLetterMessage, InterceptorChain)
Encapsulates a Message, which is a Pair of Payload and its MessageMetaData
Defines how messages can be consumed by the provided message consumer
Strategy for resolving which errors, experienced during Message delivery by the DurableQueueConsumer, should be instantly marked as a Poison-Message/Dead-Letter-Message or if we can attempt message redelivery according to the specified RedeliveryPolicy
 
 
 
Methods annotated with this Annotation will automatically be called when a PatternMatchingQueuedMessageHandler and PatternMatchingMessageHandler receives respectively a QueuedMessage or a Message where the Message.getPayload() matches the type of the first argument/parameter on a method annotated with @MessageHandler
 
Encapsulated Metadata (like headers, correlation id, tracing id's, etc.) associated with a Message
 
Variant of ListenNotify.listen(Jdbi, String, Duration) that allows you to listen for notifications from multiple tables using a single polling thread Security It is the responsibility of the user of this component to sanitize any table or column names provided to methods in this class to ensure the security of all the SQL statements generated by this component.
 
 
Interface for extracting a unique key from the JSON representation of a Notification.getParameter() JSON to determine if the notification should be duplicate.
The key extracted from NotificationDuplicationFilter.extractDuplicationKey(JsonNode) will be used inside MultiTableChangeListener for duplication checks across all Notification's returned in a single poll.
If an empty Optional is returned then the given notification won't be deduplicated.
If two or more Notification's in a given poll batch share the same duplication key, then only one of them will be published to the listeners registered with the MultiTableChangeListener
Default filter to extract the "table_name" property from a JSON parameter.
Manages a chain of NotificationDuplicationFilter instances and uses them to extract unique keys from the Notification.getParameter() JSON content.
The key extracted from NotificationDuplicationFilter.extractDuplicationKey(JsonNode) will be used inside MultiTableChangeListener for duplication checks across all Notification's returned in one poll.
If an empty Optional is returned then the given notification won't be deduplicated.
If two or more Notification's in a given poll batch share the same duplication key, then only one of them will be published to the listeners registered with the MultiTableChangeListener
Represents 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 same OrderedMessage.key, will be delivered according to their OrderedMessage.order
An example of a message key is the id of the entity the message relates to
The Outbox supports the transactional Store and Forward pattern from Enterprise Integration Patterns supporting At-Least-Once delivery guarantee.
The Outbox pattern is used to handle outgoing messages, that are created as a side effect of adding/updating an entity in a database, but where the message infrastructure (such as a Queue, Kafka, EventBus, etc.) that doesn't share the same underlying transactional resource as the database.
Instead, you need to use an Outbox that can join in the same UnitOfWork/transactional-resource that the database is using.
The message is added to the Outbox in a transaction/UnitOfWork and afterwards the UnitOfWork is committed.
If the transaction fails then both the entity and the message will be rolled back when then UnitOfWork rolls back.
After the UnitOfWork has been committed, the messages will be asynchronously delivered to the message consumer in a new UnitOfWork.
The Outbox itself supports Message Redelivery in case the Message consumer experiences failures.
This means that the Message consumer, registered with the Outbox, can and will receive Messages more than once and therefore its message handling has to be idempotent.
 
 
The Outbox supports the transactional Store and Forward pattern from Enterprise Integration Patterns supporting At-Least-Once delivery guarantee.
The Outbox pattern is used to handle outgoing messages, that are created as a side effect of adding/updating an entity in a database, but where the message infrastructure (such as a Queue, Kafka, EventBus, etc.) that doesn't share the same underlying transactional resource as the database.
Instead, you need to use an Outbox that can join in the same UnitOfWork/transactional-resource that the database is using.
IF the message is added to the Outbox in a transaction/UnitOfWork and the UnitOfWork is committed together (this is dependent on the underlying implementation - see Outboxes.DurableQueueBasedOutboxes).
In case adding the message happens in a shared transaction/UnitOfWork, then if the transaction fails then both the entity and the message will be rolled back when then UnitOfWork rolls back.
Outboxes variant that uses DurableQueues as the underlying implementation.
ONLY in cases where the underlying DurableQueues is associated with a UnitOfWorkFactory will the Outbox message consumption be performed within UnitOfWork, otherwise message consumption isn't performed with a UnitOfWork
The name of an Outbox
Pattern matching Consumer<Message> for use with Inboxes/Inbox or Outboxes/Outbox
The PatternMatchingMessageHandler will automatically call methods annotated with the @MessageHandler annotation and where the 1st argument matches the actual Message payload type (contained in the Message.getPayload() provided to the provided Consumer)
Pattern matching QueuedMessageHandler for use with DurableQueues's
The PatternMatchingQueuedMessageHandler will automatically call methods annotated with the @MessageHandler annotation and where the 1st argument matches the actual Message payload type (contained in the Message.getPayload() provided to the QueuedMessageHandler.handle(QueuedMessage) method)
 
Delete all messages (Queued or Dead letter Messages) in the given queue
Operation also matches DurableQueuesInterceptor.intercept(PurgeQueue, InterceptorChain)
Builder for PurgeQueue
Represents a Message that has been queued using QueueMessage/QueueMessages/QueueMessageAsDeadLetterMessage
 
The total number of (non-dead-letter) messages queued and number of queued dead-letter Messages for the given queue
 
The unique entry for a message in a queue.
Queue a message for asynchronous delivery optional delay to a DurableQueueConsumer
Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
Operation also matches DurableQueuesInterceptor.intercept(QueueMessage, InterceptorChain)
Queue the message directly as a Dead Letter Message.
Builder for QueueMessage
Queue multiple messages to the same queue.
Builder for QueueMessages
The name of a Durable Queue
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.
The QueuePollingOptimizer.SimpleQueuePollingOptimizer supports extending the polling sleep time (i.e. the time between calls to DurableQueues.getNextMessageReadyForDelivery(GetNextMessageReadyForDelivery)) up until a given threshold for a given queue consumer
In case the message delivery, handled by the DurableQueueConsumer, experiences an error/exception, then the RedeliveryPolicy determines, with the aid of the MessageDeliveryErrorHandler and the provided delivery settings, IF a Message should be retried (DurableQueues.retryMessage(RetryMessage) or if it's going to be marked as a Poison-Message/Dead-Letter-Message (DurableQueues.markAsDeadLetterMessage(MarkAsDeadLetterMessage))
 
Resurrect a Dead Letter Message for redelivery after the specified deliveryDelay
Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
Operation also matches DurableQueuesInterceptor.intercept(ResurrectDeadLetterMessage, InterceptorChain)
Schedule the message for redelivery after the specified deliveryDelay (called by the DurableQueueConsumer)
Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
Operation also matches DurableQueuesInterceptor.intercept(RetryMessage, InterceptorChain)
Builder for RetryMessage
 
 
 
SpringTransactionAwareUnitOfWork<TRX_MGR extends org.springframework.transaction.PlatformTransactionManager,UOW extends SpringTransactionAwareUnitOfWork<TRX_MGR,UOW>>
Spring transaction-aware UnitOfWork
Specializations can choose to override SpringTransactionAwareUnitOfWork.onStart() to initialize any datastore specific resources (e.g. a JDBI handle) and SpringTransactionAwareUnitOfWork.onCleanup() to release/cleanup the resources.
SpringTransactionAwareUnitOfWorkFactory<TRX_MGR extends org.springframework.transaction.PlatformTransactionManager,UOW extends SpringTransactionAwareUnitOfWork<TRX_MGR,UOW>>
Variant of the UnitOfWorkFactory which can delegate the creation of the underlying transaction to the provided PlatformTransactionManager instance.
The UnitOfWork type specialization needs to extend SpringTransactionAwareUnitOfWork
Log the execution time for SQL statements
Stop an asynchronous message consumer.
Is initiated when DurableQueueConsumer.cancel() is called Operation also matches DurableQueuesInterceptor.intercept(StopConsumingFromQueue, InterceptorChain)
Represents a base notification, which is a change to a given table caused by a specific ListenNotify.SqlOperation
The transactional behaviour mode of a DurableQueues.
 
CommandBusInterceptor that ensures that each Command is handled within a UnitOfWork by using the UnitOfWorkFactory.withUnitOfWork(CheckedFunction)
Represents an Exception that occurred in relation to a UnitOfWork
This interface creates a UnitOfWork
Callback that can be registered with a UnitOfWork in relation to one of more Resources (can e.g. be an Aggregate).
 
The status of a UnitOfWork