E - The type of EventMessage maintained in the dead letter of this
SequencedDeadLetterQueue.public static class JdbcSequencedDeadLetterQueue.Builder<E extends EventMessage<?>> extends Object
JdbcSequencedDeadLetterQueue.
The following defaults are set by the builder:
table's schema defaults to a DeadLetterSchema.defaultSchema().maximum amount of sequences defaults to 1024.maximum sequence size defaults to 1024.page size defaults to 100.claim duration defaults to 30 seconds.
The processing group,
ConnectionProvider, and
TransactionManager are hard requirements and should be
provided.
The statementFactory(DeadLetterStatementFactory) and
converter(DeadLetterJdbcConverter) are also hard requirements, but users can choose to either set
both explicitly or rely on the DefaultDeadLetterStatementFactory and
DefaultDeadLetterJdbcConverter constructed through the
generic Serializer and
event Serializer.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
JdbcSequencedDeadLetterQueue<E> |
build()
Initializes a
JdbcSequencedDeadLetterQueue as specified through this Builder. |
JdbcSequencedDeadLetterQueue.Builder<E> |
claimDuration(Duration claimDuration)
Sets the claim duration, which is the time a dead-letter gets locked when processing and waiting for it to
complete.
|
JdbcSequencedDeadLetterQueue.Builder<E> |
connectionProvider(ConnectionProvider connectionProvider)
Sets the
ConnectionProvider which provides access to a JDBC connection. |
JdbcSequencedDeadLetterQueue.Builder<E> |
converter(DeadLetterJdbcConverter<E,? extends JdbcDeadLetter<E>> converter)
|
JdbcSequencedDeadLetterQueue.Builder<E> |
eventSerializer(Serializer eventSerializer)
Sets the
Serializer to (de)serialize the events, metadata and diagnostics of the DeadLetter
when storing it to a database. |
JdbcSequencedDeadLetterQueue.Builder<E> |
genericSerializer(Serializer genericSerializer)
Sets the
Serializer to (de)serialize the TrackingToken (if
present) of the event in the DeadLetter when storing it to the database. |
JdbcSequencedDeadLetterQueue.Builder<E> |
maxSequences(int maxSequences)
Sets the maximum number of unique sequences this
SequencedDeadLetterQueue may contain. |
JdbcSequencedDeadLetterQueue.Builder<E> |
maxSequenceSize(int maxSequenceSize)
Sets the maximum amount of
letters per unique sequences this
SequencedDeadLetterQueue can store. |
JdbcSequencedDeadLetterQueue.Builder<E> |
pageSize(int pageSize)
Modifies the page size used when retrieving a sequence of dead letters.
|
JdbcSequencedDeadLetterQueue.Builder<E> |
processingGroup(String processingGroup)
Sets the processing group, which is used for storing and querying which processing group a dead-lettered
EventMessage belonged to. |
JdbcSequencedDeadLetterQueue.Builder<E> |
schema(DeadLetterSchema schema)
Sets the
DeadLetterSchema used to constructs the table and indices required by this
SequencedDeadLetterQueue. |
JdbcSequencedDeadLetterQueue.Builder<E> |
statementFactory(DeadLetterStatementFactory<E> statementFactory)
Sets the
DeadLetterStatementFactory used to construct all
PreparedStatements executed by this SequencedDeadLetterQueue. |
JdbcSequencedDeadLetterQueue.Builder<E> |
transactionManager(TransactionManager transactionManager)
Sets the
TransactionManager used to manage transaction around fetching dead-letter data. |
protected void |
validate()
Validate whether the fields contained in this Builder are set accordingly.
|
public JdbcSequencedDeadLetterQueue.Builder<E> processingGroup(@Nonnull String processingGroup)
EventMessage belonged to.processingGroup - The processing group of this SequencedDeadLetterQueue.public JdbcSequencedDeadLetterQueue.Builder<E> connectionProvider(@Nonnull ConnectionProvider connectionProvider)
ConnectionProvider which provides access to a JDBC connection.connectionProvider - a ConnectionProvider which provides access to a JDBC connectionpublic JdbcSequencedDeadLetterQueue.Builder<E> transactionManager(@Nonnull TransactionManager transactionManager)
TransactionManager used to manage transaction around fetching dead-letter data.transactionManager - A TransactionManager used to manage transaction around fetching dead-letter
data.public JdbcSequencedDeadLetterQueue.Builder<E> schema(@Nonnull DeadLetterSchema schema)
DeadLetterSchema used to constructs the table and indices required by this
SequencedDeadLetterQueue.
The schema will be used to construct the DeadLetterStatementFactory when it is not explicitly
configured.
Defaults to the default schema configuration.
schema - The DeadLetterSchema used to constructs the table and indices required by this
dead-letter queue.public JdbcSequencedDeadLetterQueue.Builder<E> statementFactory(@Nonnull DeadLetterStatementFactory<E> statementFactory)
DeadLetterStatementFactory used to construct all
PreparedStatements executed by this SequencedDeadLetterQueue.
When the statementFactory is not explicitly configured, this builder defaults to the
DefaultDeadLetterStatementFactory. To construct the DefaultDeadLetterStatementFactory, the
configured schema,
generic Serializer, and
event Serializer are used.
statementFactory - The DeadLetterStatementFactory used to construct all
PreparedStatements executed by this
SequencedDeadLetterQueue.public JdbcSequencedDeadLetterQueue.Builder<E> converter(@Nonnull DeadLetterJdbcConverter<E,? extends JdbcDeadLetter<E>> converter)
DeadLetterJdbcConverter used to convert a ResultSet into a
JdbcDeadLetter implementation. The converter is, for example, used to service the
JdbcSequencedDeadLetterQueue.deadLetters() and JdbcSequencedDeadLetterQueue.deadLetterSequence(Object) operations.
When the converter is not explicitly configured, this builder defaults to the
DefaultDeadLetterJdbcConverter. To construct the DefaultDeadLetterJdbcConverter, the
configured generic Serializer, and
event Serializer are used.
converter - The DeadLetterJdbcConverter used to convert a ResultSet into a
JdbcDeadLetter implementation.public JdbcSequencedDeadLetterQueue.Builder<E> genericSerializer(@Nonnull Serializer genericSerializer)
Serializer to (de)serialize the TrackingToken (if
present) of the event in the DeadLetter when storing it to the database.
The genericSerializer will be used to construct the DeadLetterStatementFactory and/or
DeadLetterJdbcConverter when either of them are not explicitly configured.
genericSerializer - The serializer to use.public JdbcSequencedDeadLetterQueue.Builder<E> eventSerializer(@Nonnull Serializer eventSerializer)
Serializer to (de)serialize the events, metadata and diagnostics of the DeadLetter
when storing it to a database.
The eventSerializer will be used to construct the DeadLetterStatementFactory and/or
DeadLetterJdbcConverter when either of them are not explicitly configured.
eventSerializer - The serializer to use.public JdbcSequencedDeadLetterQueue.Builder<E> maxSequences(int maxSequences)
SequencedDeadLetterQueue may contain.
The given maxSequences is required to be a positive number. The maximum number of unique sequences
defaults to 1024.
maxSequences - The maximum amount of unique sequences for the queue under construction.public JdbcSequencedDeadLetterQueue.Builder<E> maxSequenceSize(int maxSequenceSize)
letters per unique sequences this
SequencedDeadLetterQueue can store.
The given maxSequenceSize is required to be a positive number. The maximum amount of letters per
unique sequence defaults to 1024.
maxSequenceSize - The maximum amount of letters per unique sequence.public JdbcSequencedDeadLetterQueue.Builder<E> claimDuration(@Nonnull Duration claimDuration)
JdbcSequencedDeadLetterQueue.process(Predicate, Function) method will be unable to process a
sequence while the claim is active. The claim duration defaults to 30 seconds.
Claims are automatically released once the item is requeued. Thus, the claim time is a backup policy in case of unforeseen trouble such as database connection issues.
claimDuration - The longest claim duration allowed.public JdbcSequencedDeadLetterQueue.Builder<E> pageSize(int pageSize)
Used during the JdbcSequencedDeadLetterQueue.deadLetterSequence(Object) and JdbcSequencedDeadLetterQueue.deadLetters() operations. Defaults to a
100.
pageSize - The page size used when retrieving a sequence of dead letters.public JdbcSequencedDeadLetterQueue<E> build()
JdbcSequencedDeadLetterQueue as specified through this Builder.JdbcSequencedDeadLetterQueue as specified through this Builder.protected void validate()
AxonConfigurationException - When one field asserts to be incorrect according to the Builder's
specifications.Copyright © 2010–2025. All rights reserved.