Skip to content

a very little dependency task control tool in eureka cluster

Notifications You must be signed in to change notification settings

wanggang1987/task-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

task-spring-boot-starter

a distributed task module

version 0.1.0

Supporting distributed services, find the first service registered to Eureka as master, and then the master performs timing tasks.To support docker containers, you need to configure the environment variable "EUREKA_INSTANCE_IP_ADDRESS", which is the IP of the container service node.

use example as follows:

  • step1:
@SpringBootApplication
@EnableDiscoveryClient
@EnableDistributedTask
@EnableScheduling
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
  • step2:
@Component
public class MySchedule {
    @OneTask
    @Scheduled(fixedRate = 5000)
    public void exec() {
        System.out.println("In distributed microservices, only one machine executes");
    }
}

About

a very little dependency task control tool in eureka cluster

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages