You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of our projects implemented a task execution listener by annotating methods with @BeforeTask and @AfterTask. That task execution listener also implemented the ApplicationRunner interface to run the actual task.
Task observability was turned on with the spring.cloud.task.observation.enabled=true configuration property.
ObservationApplicationRunnerBeanPostProcessor discovers our ApplicationRunner implementation and wraps it into an ObservationApplicationRunner. As a result, the task execution listener plumbing in TaskLifecycleConfiguration and/or TaskLifecycleListener no longer detects the class as a task execution listener and the methods annotated with @BeforeTask and @AfterTask are no longer executed.
What did you expect to happen?
A class that implements ApplicationRunner should also be able to implement the TaskExecutionListener interface or annotate methods with the @BeforeTask, @AfterTask or @FailedTask without change in behaviour if task observability is turned on.
What happened?
Some of our projects implemented a task execution listener by annotating methods with
@BeforeTask
and@AfterTask
. That task execution listener also implemented theApplicationRunner
interface to run the actual task.Task observability was turned on with the
spring.cloud.task.observation.enabled=true
configuration property.ObservationApplicationRunnerBeanPostProcessor
discovers ourApplicationRunner
implementation and wraps it into anObservationApplicationRunner
. As a result, the task execution listener plumbing inTaskLifecycleConfiguration
and/orTaskLifecycleListener
no longer detects the class as a task execution listener and the methods annotated with@BeforeTask
and@AfterTask
are no longer executed.What did you expect to happen?
A class that implements
ApplicationRunner
should also be able to implement theTaskExecutionListener
interface or annotate methods with the@BeforeTask
,@AfterTask
or@FailedTask
without change in behaviour if task observability is turned on.How can we reproduce it?
Please find a reproducer here: ferdinandhuebner/spring-cloud-task-listener-executor-bug:
ApplicationRunner
implementation that has methods annotated with@BeforeTask
and@AfterTask
: TaskListenerExecutorBugTestAnything else we need to know?
2022.0.4
3.0.3
3.1.5
The text was updated successfully, but these errors were encountered: