-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Support Reactive methods #1470
Comments
Hi, I will look into that. In the meantime, can you please explain what's the use-case for reactive scheduled method. Thanks |
Hi, Previously, if code-base was reactive, it was up to the developer to actually bridge the reactive piece of code with the Spring Scheduler. You would need to explicitly subscribe to / block the reactive pipeline to start a scheduled task. On top of that, This new feature also supports different types of The developer does not need to worry about bridging the piece of reactive code with Springs' Scheduler, it is handled by the framework itself, including subscribing to the provided |
Thanks, I looked into that and it's going to be tricky.
So, unless somebody will be able to contribute the code, this is not going to happen. For those thinking about contributing the code:
|
Is your feature request related to a problem? Please describe.
With the new Spring
6.1.0-M1
version, methods annotated with@Scheduled
can now returnPublisher
types e.g (Mono
,Flux
, etc.) spring-projects/spring-framework#29924Currently Shedlock does not support this and the application startup fails with the following message:
Caused by: java.lang.IllegalStateException: Could not create recurring task for @Scheduled method 'reportPendingReports': Cannot obtain a Publisher-convertible value from the @Scheduled reactive method
.You can trick Spring by configuring Shedlock
interceptMode
toEnableSchedulerLock.InterceptMode.PROXY_SCHEDULER
, but then Shedlock autoconfiguration silently fails becauseSpringLockConfigurationExtractor
only supports tasks of typeScheduledMethodRunnable
and the task type isorg.springframework.scheduling.annotation.ScheduledAnnotationReactiveSupportSubscribingRunnable
. Therefore lock configuration is not acquired andDefaultLockManager
executes the task without a lock.The text was updated successfully, but these errors were encountered: