DEV Community

silenzzz
silenzzz

Posted on

I built a Spring Boot starter that exposes a REST API for your @Scheduled methods

If you've ever needed to manually trigger a @Scheduled method in production without redeploying or adding one-off
endpoints, this might be useful.

The problem

I kept running into the same situation: a scheduled job needs to run right now — data sync is behind, a report needs
regenerating, whatever. The options were never great:

  • Add a temporary REST endpoint, deploy, trigger, remove, redeploy
  • SSH into the server and fiddle with the database
  • Just wait for the next scheduled run

What I built

cronctl-spring-boot-starter — add the dependency, and every @Scheduled method in your application gets automatically
registered and exposed via REST:

GET /api/cronctl/tasks → list all registered tasks with their schedule config

POST /api/cronctl/execute/{id} → manually trigger a task, get execution result

Autoconfiguration handles everything. No annotations, no code changes to existing beans:

@Component
public class MyScheduler {

    @Scheduled(cron = "0 0 3 * * *")
    public void generateReport() {
        // this is now triggerable via POST /api/cronctl/execute/{id}                                                    
    }
}
Enter fullscreen mode Exit fullscreen mode

Swagger UI is included and shows the cronctl group alongside your existing API docs.

Security is configurable — by default, everything is public for easy local development, you can require authentication per endpoint group.

Stack: Spring Boot 4.x, Java 21, springdoc-openapi

GitHub: https://github.com/syntezis-ru/cronctl

Would love feedback — especially on the security configuration approach; I'm not sure if I've got the defaults right for a library

Top comments (0)