E
- An implementation of EventMessage
contained within the JdbcDeadLetter
implementation this
converter converts.public class DefaultDeadLetterJdbcConverter<E extends EventMessage<?>> extends Object implements DeadLetterJdbcConverter<E,JdbcDeadLetter<E>>
DeadLetterJdbcConverter
, converting ResultSets
into
JdbcDeadLetter
instances.
This converter expects a DeadLetterSchema
to define the column names / labels used to retrieve the fields
from the ResultSet
. Furthermore, it uses the configurable genericSerializer
to deserialize
TrackingTokens
for TrackedEventMessage
instances. Lastly, this factory uses the
eventSerializer
to deserialize the event payload
,
MetaData
, and diagnostics
for the
JdbcDeadLetter
to return.
Modifier and Type | Class and Description |
---|---|
protected static class |
DefaultDeadLetterJdbcConverter.Builder<E extends EventMessage<?>>
Builder class to instantiate a
DefaultDeadLetterJdbcConverter . |
Modifier | Constructor and Description |
---|---|
protected |
DefaultDeadLetterJdbcConverter(DefaultDeadLetterJdbcConverter.Builder<E> builder)
Instantiate a default
DeadLetterJdbcConverter based on the given builder . |
Modifier and Type | Method and Description |
---|---|
static <E extends EventMessage<?>> |
builder()
Instantiate a builder to construct a
DefaultDeadLetterJdbcConverter . |
JdbcDeadLetter<E> |
convertToLetter(ResultSet resultSet)
Converts the given
resultSet in an implementation of JdbcDeadLetter . |
protected DefaultDeadLetterJdbcConverter(DefaultDeadLetterJdbcConverter.Builder<E> builder)
DeadLetterJdbcConverter
based on the given builder
.
Will validate whether the generic Serializer
and
event Serializer
are set. If for either this is not the case an
AxonConfigurationException
is thrown.
builder
- The DefaultDeadLetterJdbcConverter.Builder
used to instantiate a DefaultDeadLetterJdbcConverter
instance.public static <E extends EventMessage<?>> DefaultDeadLetterJdbcConverter.Builder<E> builder()
DefaultDeadLetterJdbcConverter
.
The schema
is defaulted to a DeadLetterSchema.defaultSchema()
.
The generic Serializer
and
event Serializer
are hard requirements and should be provided.
E
- An implementation of EventMessage
contained within the JdbcDeadLetter
implementation
this converter converts.DefaultDeadLetterJdbcConverter
.public JdbcDeadLetter<E> convertToLetter(ResultSet resultSet) throws SQLException
DeadLetterJdbcConverter
resultSet
in an implementation of JdbcDeadLetter
.
It is recommended to validate the type of EventMessage
to place in the result, as different types require
additional information to be deserialized and returned.
convertToLetter
in interface DeadLetterJdbcConverter<E extends EventMessage<?>,JdbcDeadLetter<E extends EventMessage<?>>>
resultSet
- The ResultSet
to convert into a JdbcDeadLetter
JdbcDeadLetter
based on the given resultSet
.SQLException
- if the a columnLabel
in the given resultSet
does not exist, if a database
access error occurs or if the given resultSet
is closed.Copyright © 2010–2024. All rights reserved.