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
Operation also matches
Note this method MUST be called within an existing
UnitOfWork IF
using TransactionalMode.FullyTransactionalOperation also matches
DurableQueuesInterceptor.intercept(AcknowledgeMessageAsHandled, InterceptorChain)Builder for
AcknowledgeMessageAsHandledVersion of UnitOfWork that's aware of the
Will likely be removed in the future as having access to the ClientSession doesn't seem to be needed
ClientSession associated with the current UnitOfWorkWill 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
Note: There can only be one
DurableQueueConsumer per QueueName per DurableQueues instance
Operation also matches DurableQueuesInterceptor.intercept(ConsumeFromQueue, InterceptorChain)Builder for
ConsumeFromQueueA correlation id is used to link multiple Messages or Events together in a distributed system
DefaultDurableQueueConsumer<DURABLE_QUEUES extends DurableQueues,UOW extends UnitOfWork,UOW_FACTORY extends UnitOfWorkFactory<UOW>>
The default
Log levels of interest:
DurableQueueConsumer which 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 Queue
Delete a message (Queued or Dead Letter Message)
Note this method MUST be called within an existing
Operation also matches
Note this method MUST be called within an existing
UnitOfWork IF
using TransactionalMode.FullyTransactionalOperation also matches
DurableQueuesInterceptor.intercept(DeleteMessage, InterceptorChain)Builder for
DeleteMessageProvides a JVM local and durable,
in regard to
Durability for
Which
The
Note: If the
Due to this the
DurableLocalCommandBus.sendAndDontWait(Object)/DurableLocalCommandBus.sendAndDontWait(Object, Duration)),
variant of the CommandBus conceptDurability for
DurableLocalCommandBus.sendAndDontWait(Object)/DurableLocalCommandBus.sendAndDontWait(Object, Duration)) is delegated
to DurableQueuesWhich
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.RethrowingSendAndDontWaitErrorHandlerBuilder for
DurableLocalCommandBusDurableQueues consumerNotification interface that
This is required for
DurableQueueConsumer can implement
if they want to be notified about messages being added to the queue they're consuming fromThis is required for
DurableQueueConsumer's that use a QueuePollingOptimizerThe
The only requirement is that message producers and message consumers can access the same underlying durable Queue storage.
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()An Event id provides a unique identifier for an Event
Builder for
RedeliveryPolicy that allows for defining
an Exponential Backoff strategy - similar to RedeliveryPolicyBuilderRepresents a named fenced lock, where the
The fence locking concept is described here https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html
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
Only one
The implementation has been on supporting intra-service (i.e.
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.
A builder for defining a
RedeliveryPolicy with a Fixed Backoff strategyGeneric
This class is built for inheritance, but can also be used directly - e.g.
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.
Get a queued message that's marked as a
Operation also matches
QueuedMessage.isDeadLetterMessage()Operation also matches
DurableQueuesInterceptor.intercept(GetDeadLetterMessage, InterceptorChain)Builder for
GetDeadLetterMessageQuery Dead Letter Messages (i.e.
Builder for
GetDeadLetterMessagesQuery the next Queued Message (i.e.
Builder for
GetNextMessageReadyForDeliveryGet a queued message that is NOT marked as a
Operation also matches
QueuedMessage.isDeadLetterMessage()Operation also matches
DurableQueuesInterceptor.intercept(GetQueuedMessage, InterceptorChain)Builder for
GetQueuedMessageQuery Queued Messages (i.e.
Builder for
GetQueuedMessagesGet the total number of dead-letter-messages/poison-messages queued for the given queue
Operation also matched
Operation also matched
DurableQueuesInterceptor.intercept(GetTotalDeadLetterMessagesQueuedFor, InterceptorChain)Builder for
GetTotalDeadLetterMessagesQueuedForGet the total number of messages queued (i.e.
Builder for
GetTotalMessagesQueuedForVersion of UnitOfWork that's aware of the
Handle associated with the current UnitOfWorkSpecialization of
UnitOfWorkFactory that created and maintains HandleAwareUnitOfWork'sThe name of an
InboxJackson
ObjectMapper based JSONSerializerJSON serializer and deserializer
Common process life cycle interface
A builder for defining a
RedeliveryPolicy with a Linear Backoff strategyHelper class for setting up the NOTIFY part of the classical Postgresql LISTEN/NOTIFY concept.
See https://jdbc.postgresql.org/documentation/81/listennotify.html and
https://www.postgresql.org/docs/current/sql-notify.html
See https://jdbc.postgresql.org/documentation/81/listennotify.html and
https://www.postgresql.org/docs/current/sql-notify.html
Contains the name of a
FencedLockMark an already Queued Message as a Dead Letter Message (or Poison Message).
Dead Letter Messages won't be delivered to any
To deliver a Dead Letter Message you must first resurrect the message using
Note this method MUST be called within an existing
Operation also matches
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.FullyTransactionalOperation also matches
DurableQueuesInterceptor.intercept(MarkAsDeadLetterMessage, InterceptorChain)Builder for
MarkAsDeadLetterMessageEncapsulates a Message, which is a
Pair of Payload and its MessageMetaDataDefines 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 RedeliveryPolicyBuilder for
MessageDeliveryErrorHandlerMethods 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 @MessageHandlerA message id provides a unique identifier for a Message in a distributed system
Encapsulated Metadata (like headers, correlation id, tracing id's, etc.) associated with a
MessageVariant of
ListenNotify.listen(Jdbi, String, Duration) that allows you to listen for notifications from multiple tables using a single polling threadRepresents 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
An example of a message key is the id of the entity the message relates to
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.orderAn example of a message key is the id of the entity the message relates to
The
The
Instead, you need to use an
The message is added to the
If the transaction fails then both the entity and the message will be rolled back when then
After the
The
This means that the Message consumer, registered with 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
The
Instead, you need to use an
The message is added to the
If the transaction fails then both the entity and the message will be rolled back when then
After the
The
This means that the Message consumer, registered with 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 name of an
OutboxPattern matching Consumer<Message> for use with
The
Inboxes/Inbox or Outboxes/OutboxThe
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
The
QueuedMessageHandler for use with DurableQueues'sThe
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
Operation also matches
DurableQueuesInterceptor.intercept(PurgeQueue, InterceptorChain)Builder for
PurgeQueueRepresents a
Message that has been queued using QueueMessage/QueueMessages/QueueMessageAsDeadLetterMessageThe unique entry for a message in a queue.
Queue a message for asynchronous delivery optional delay to a
Note this method MUST be called within an existing
Operation also matches
DurableQueueConsumerNote this method MUST be called within an existing
UnitOfWork IF
using TransactionalMode.FullyTransactionalOperation also matches
DurableQueuesInterceptor.intercept(QueueMessage, InterceptorChain)Queue the message directly as a Dead Letter Message.
Builder for
QueueMessageAsDeadLetterMessageBuilder for
QueueMessageQueue multiple messages to the same queue.
Builder for
QueueMessagesThe name of a Durable Queue
Optimizer designed to work together with the
The optimizer is responsible for optimizing the frequency by which the
If a given Queue doesn't experience a high influx of message, or a lot of message's have (
The
DefaultDurableQueueConsumerThe 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
QueuePollingOptimizer.SimpleQueuePollingOptimizer supports extending the polling sleep time (i.e.RandomId generator that either:
Generates UUIDv1 time-based (i.e.
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
Note this method MUST be called within an existing
Operation also matches
deliveryDelayNote this method MUST be called within an existing
UnitOfWork IF
using TransactionalMode.FullyTransactionalOperation also matches
DurableQueuesInterceptor.intercept(ResurrectDeadLetterMessage, InterceptorChain)Builder for
ResurrectDeadLetterMessageSchedule the message for redelivery after the specified
Note this method MUST be called within an existing
Operation also matches
deliveryDelay (called by the DurableQueueConsumer)Note this method MUST be called within an existing
UnitOfWork IF
using TransactionalMode.FullyTransactionalOperation also matches
DurableQueuesInterceptor.intercept(RetryMessage, InterceptorChain)Builder for
RetryMessageA
SpringTransactionAwareUnitOfWorkFactory version of the HandleAwareUnitOfWorkFactory which supports the standard HandleAwareUnitOfWork using JdbiSpringTransactionAwareUnitOfWork<TRX_MGR extends org.springframework.transaction.PlatformTransactionManager,UOW extends SpringTransactionAwareUnitOfWork<TRX_MGR,UOW>>
Spring transaction-aware
Specializations can choose to override
UnitOfWorkSpecializations can choose to override
SpringTransactionAwareUnitOfWork.onStart() to initialize any datastore specific resources (e.g.SpringTransactionAwareUnitOfWorkFactory<TRX_MGR extends org.springframework.transaction.PlatformTransactionManager,UOW extends SpringTransactionAwareUnitOfWork<TRX_MGR,UOW>>
Variant of the
The
UnitOfWorkFactory which can delegate the creation of the underlying transaction to the provided PlatformTransactionManager instance.The
UnitOfWork type specialization needs to extend SpringTransactionAwareUnitOfWorkLog the execution time for SQL statements
Stop an asynchronous message consumer.
Is initiated when
Is initiated when
DurableQueueConsumer.cancel() is called
Operation also matches DurableQueuesInterceptor.intercept(StopConsumingFromQueue, InterceptorChain)Builder for
StopConsumingFromQueueA subscriber id is used to uniquely identify an event subscriber
Represents a base notification, which is a change to a given table caused by a specific
ListenNotify.SqlOperationMarker interface for types that are used to distinguish between Tenant
specific data in a data store.
A tenant can be as simple as a
The serialization of the tenant is always the
A tenant can be as simple as a
SingleValueType or it can be more
complex such as including both Tenant-Id and a CountryCode denoting
the country where the Tenant data is owned.The serialization of the tenant is always the
Object.toString() value,
and it is deserialized by using a default single string argument constructorSimple single value
Tenant identifierThe 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
UnitOfWorkThis interface creates a
UnitOfWorkCallback that can be registered with a
UnitOfWork in relation to
one of more Resources (can e.g.The status of a
UnitOfWork