Class JpaDeadLetterQueueAutoConfiguration
SequencedDeadLetterQueueFactory bean.
This configuration activates when a EntityManagerFactory bean is present (i.e. JPA is on the
classpath and configured). The registered factory creates a JpaSequencedDeadLetterQueue
instance per event handling component, using the application's EntityManagerFactory,
EventConverter, and Converter. Each queue is scoped by a component-level processing
group identifier (e.g. "DeadLetterQueue[myProcessor][0]").
To enable Dead Letter Queue processing for a specific processor, set:
axon.eventhandling.processors.<processorName>.dlq.enabled=true
The cache size used for sequence identifier caching can be tuned per processor:
axon.eventhandling.processors.<processorName>.dlq.cache.size=2048
To replace the default JPA factory with a custom backend, declare your own SequencedDeadLetterQueueFactory
bean — the @ConditionalOnMissingBean guard on the default will yield to it.
- Since:
- 5.1.0
- Author:
- Mateusz Nowak
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjpaDeadLetterQueueFactory(jakarta.persistence.EntityManagerFactory entityManagerFactory, EventConverter eventConverter, Converter genericConverter) Creates a JPA-backedSequencedDeadLetterQueueFactorythat instantiates aJpaSequencedDeadLetterQueueper event handling component.
-
Constructor Details
-
JpaDeadLetterQueueAutoConfiguration
public JpaDeadLetterQueueAutoConfiguration()
-
-
Method Details
-
jpaDeadLetterQueueFactory
@Bean @ConditionalOnMissingBean public SequencedDeadLetterQueueFactory jpaDeadLetterQueueFactory(jakarta.persistence.EntityManagerFactory entityManagerFactory, EventConverter eventConverter, Converter genericConverter) Creates a JPA-backedSequencedDeadLetterQueueFactorythat instantiates aJpaSequencedDeadLetterQueueper event handling component.The
processingGrouppassed to the factory is a component-scoped identifier following the pattern"DeadLetterQueue[processorName][componentName]", used to scope dead letters in the database. Theconfigurationparameter is ignored in this Spring implementation since all dependencies are wired via Spring bean injection.- Parameters:
entityManagerFactory- The JPAEntityManagerFactoryused for persistence.eventConverter- TheEventConverterused to convert event payloads and metadata.genericConverter- The genericConverterused for type conversion.- Returns:
- A
SequencedDeadLetterQueueFactorybacked by JPA.
-