Hello,

I am working on a scheduled task @Scheduled annotated. I am currently learning that I can leverage spring cloud task to create small individual microservices to separate business logic of each task.

During this learning journey, I stumbled upon some properties

SpringBoot Improve documentation on spring cloud task properties vs spring boot scheduled task properties

ref: https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html#application-properties.core.spring.task.execution.shutdown.await-termination

With a naive look, I became confused If this configuration is for spring cloud tasks or for spring @Scheduled annotation. I understand that cloud task properties start with spring.cloud.task, but it is confusing at first look.

I am not sure where to put this issue, after lot of thought have put here. Some questions I agree should go to task project but its still quite confusing where to put so consolidating here.

My request is : 1. If we can somehow improve documentation for @Scheduled and also Spring cloud task to ensure properties dont mix up. So that, developers are aware which properties are for what purpose. 2. Also, can I create a scheduled job with spring cloud task with @Scheduled inside spring cloud task. If yes, will this boot properties work? 3. As a last resort can we rename these properties to not to be confused with spring cloud task.

Thank you very much for your hard work and awesome contribution to developer community.

Comment From: wilkinsona

Thanks for the suggestions.

There are three projects involved here:

  1. Spring Framework that provides task scheduling (TaskSchedular) and task execution (TaskExecutor)
  2. Spring Boot that provides auto-configuration for Spring Framework's task scheduling and task execution
  3. Spring Cloud Task

In terms of dependencies Spring Cloud Task depends on Spring Boot and Spring Boot depends on Spring Framework.

If we can somehow improve documentation for @Scheduled and also Spring cloud task to ensure properties dont mix up. So that, developers are aware which properties are for what purpose.

This should be handled in Spring Cloud Task's documentation where the overloading of the "task" term was introduced. In terms of the dependencies between projects, Spring Cloud Task is also the right place to handle this.

Also, can I create a scheduled job with spring cloud task with @Scheduled inside spring cloud task. If yes, will this boot properties work?

This is a question for the Spring Cloud task team.

In general terms, the spring.task.scheduling properties are used to configure the ThreadPoolTaskScheduler that Spring Boot's auto-configures for you when task scheduling has been enabled. This auto-configuration will back off if a SchedulingConfigurer, TaskScheduler, or ScheduledExecutorService has already been defined.

As a last resort can we rename these properties to not to be confused with spring cloud task.

The properties are carefully named after the concepts in Spring Framework that they configure. As such, while I sympathise with the clash in terminology with Spring Cloud Task, it would be counter-productive for most users to rename Spring Boot's properties. Hopefully things can be clarified in Spring Cloud Task.

Comment From: swapy

Thanks @wilkinsona I will raise it in Spring cloud task project.