Skip to content

Easy-Cron-Scheduler-V1.0.1

Latest
Compare
Choose a tag to compare
@comradexy comradexy released this 18 Aug 13:09
· 52 commits to master since this release

Instructions

  1. Extract to the local Maven repository;
  2. Set up the following configuration:
server:
  port: 8080

logging:
  level:
    root: info

comradexy:
  middleware:
    scheudle:
      schedulerServerId: CUSTOM_SERVER_ID
      schedulerServerName: CUSTOM_SERVER_NAME
      schedulerPoolSize: 8
      enableStorage: true     # turn on to use persistent service
      enableAdmin: true     # turn on to use admin service
      storageType: jdbc     # currently only supports jdbc
      dataSource:
      # The following configuration is based on your local MySQL environment
      url: jdbc: mysql://localhost:3306/easy_cron_scheduler?useUnicode=true&characterEncoding=utf -8&useSSL=false
      username: root
      password: 1234
  1. Add @EnableEzScheduling to the startup class to enable the scheduled task service;
  2. Define a method in Spring Bean with a return value of void as the task handler, decorated with @EzScheduled (If you want to add multiple @EzScheduled on the same method, please use @EzSchedule to combine them ) above the method, and configure the cron (required), desc, endTime (format: yyyy-MM-ddTmm:ss ), and maxExecutCount parameters in the annotation to enable scheduled tasks;
  3. After startup, you can access the management interface through host:port/ecs_admin .