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
Before Spring Framework 6.1, @Scheduled methods returning a Publisher type were not supported. In your case, the method itself was executed but the returned publisher was never subscribed to.
As of #29924 this is now supported. This means that such methods are executed right away to get the publisher and then schedule its subscription when the cron is due. Maybe your scheduled method has a log statement in it? In any case, a method returning a Publisher should be lazy and should not have side effects before subscription happens.
I have an application currently running on Springboot 3.1.2. The app having @scheduled method with cron expression.
As soon as I update the spring-boot version to 3.2.2 the first execution happens immediately after the application startup.
If I switch back to 3.1.2 this doesn't happen and the scheduled job executes only at the time defined in CRON.
Is there something that we have to take care during the upgrade.
##Method :
@scheduled(cron = "${cron.expression.maximize-value}", zone = "${cron.timezone}")
public Flux maximizeValue() {...}
The class is annotated with @service.
The text was updated successfully, but these errors were encountered: