Class RetryTopicSchedulerWrapper
java.lang.Object
org.springframework.kafka.retrytopic.RetryTopicSchedulerWrapper
- All Implemented Interfaces:
DisposableBean
,InitializingBean
A wrapper class for a
TaskScheduler
to use for scheduling container resumption
when a partition has been paused for a retry topic. Using this class prevents breaking
Spring Boot's auto configuration for other frameworks. Use this if you are using Spring
Boot and do not want to use that auto configured scheduler (if it is configured). This
framework requires a scheduler bean and looks for one in this order: 1. A single
instance of this class, 2. a single TaskScheduler
bean, 3. when multiple
TaskScheduler
s are present, a bean with the name taskScheduler
.
If you use this class, you should provide a TaskScheduler
that is not defined
as a bean; this class will maintain the scheduler's lifecycle.- Since:
- 2.9
- Author:
- Gary Russell
-
Constructor Summary
ConstructorDescriptionRetryTopicSchedulerWrapper
(TaskScheduler scheduler) Create a wrapper for the supplied scheduler. -
Method Summary
-
Constructor Details
-
RetryTopicSchedulerWrapper
Create a wrapper for the supplied scheduler.- Parameters:
scheduler
- the scheduler
-
-
Method Details
-
getScheduler
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
Exception
-
destroy
- Specified by:
destroy
in interfaceDisposableBean
- Throws:
Exception
-