Class RetryTopicSchedulerWrapper
- java.lang.Object
-
- org.springframework.kafka.retrytopic.RetryTopicSchedulerWrapper
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
public class RetryTopicSchedulerWrapper extends java.lang.Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
A wrapper class for aTaskScheduler
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 singleTaskScheduler
bean, 3. when multipleTaskScheduler
s are present, a bean with the nametaskScheduler
. If you use this class, you should provide aTaskScheduler
that is not defined as a bean; this class will maintain the scheduler's lifecycle.- Since:
- 2.9
-
-
Constructor Summary
Constructors Constructor Description RetryTopicSchedulerWrapper(org.springframework.scheduling.TaskScheduler scheduler)
Create a wrapper for the supplied scheduler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
destroy()
org.springframework.scheduling.TaskScheduler
getScheduler()
-
-
-
Method Detail
-
getScheduler
public org.springframework.scheduling.TaskScheduler getScheduler()
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
-
destroy
public void destroy() throws java.lang.Exception
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception
-
-