Class DefaultDeadLetterJdbcConverter<E extends EventMessage>
- Type Parameters:
E- An implementation ofEventMessagecontained within theJdbcDeadLetterimplementation this converter converts.
- All Implemented Interfaces:
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 genericConverter to convert
TrackingTokens and diagnostics. Lastly, this converter uses the eventConverter to
convert the event payload and Metadata for the
JdbcDeadLetter to return.
- Since:
- 4.8.0
- Author:
- Steven van Beelen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classBuilder class to instantiate aDefaultDeadLetterJdbcConverter. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiate a defaultDeadLetterJdbcConverterbased on the givenbuilder. -
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends EventMessage>
DefaultDeadLetterJdbcConverter.Builder<E> builder()Instantiate a builder to construct aDefaultDeadLetterJdbcConverter.convertToLetter(ResultSet resultSet) Converts the givenresultSetin an implementation ofJdbcDeadLetter.
-
Constructor Details
-
DefaultDeadLetterJdbcConverter
Instantiate a defaultDeadLetterJdbcConverterbased on the givenbuilder.Will validate whether the
generic ConverterandEventConverterare set. If for either this is not the case anAxonConfigurationExceptionis thrown.- Parameters:
builder- TheDefaultDeadLetterJdbcConverter.Builderused to instantiate aDefaultDeadLetterJdbcConverterinstance.
-
-
Method Details
-
builder
Instantiate a builder to construct aDefaultDeadLetterJdbcConverter.The
schemais defaulted to aDeadLetterSchema.defaultSchema(). Thegeneric ConverterandEventConverterare hard requirements and should be provided.- Type Parameters:
E- An implementation ofEventMessagecontained within theJdbcDeadLetterimplementation this converter converts.- Returns:
- A builder that can construct a
DefaultDeadLetterJdbcConverter.
-
convertToLetter
Description copied from interface:DeadLetterJdbcConverterConverts the givenresultSetin an implementation ofJdbcDeadLetter.It is recommended to validate the type of
EventMessageto place in the result, as different types require additional information to be deserialized and returned.- Specified by:
convertToLetterin interfaceDeadLetterJdbcConverter<E extends EventMessage,JdbcDeadLetter<E extends EventMessage>> - Parameters:
resultSet- TheResultSetto convert into aJdbcDeadLetter- Returns:
- An implementation of
JdbcDeadLetterbased on the givenresultSet. - Throws:
SQLException- if the acolumnLabelin the givenresultSetdoes not exist, if a database access error occurs or if the givenresultSetis closed.
-