springboot——分佈式定時調度schedulerx

詳情:https://www.cnblogs.com/cloudml/p/4721395.html

schedulerx可以實現界面化操作配置任務,包括:任務的調用週期,是否啓用,任務類型等

實現

1、添加依賴

        <dependency>
            <groupId>com.alibaba.boot</groupId>
            <artifactId>pandora-schedulerx-spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.alibaba</groupId>
                    <artifactId>fastjson</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- schedulerx 依賴 druid,所以需要依賴tddl starter -->
        <dependency>
            <groupId>com.alibaba.boot</groupId>
            <artifactId>pandora-tddl-spring-boot-starter</artifactId>
        </dependency>

2、task任務implements SimpleJobProcessor

3、到調度中心配置任務

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章