热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_38289483
口叮码农CodingFarmer
5 年前
trueweixin_38289483

python+java混合编程

CSDN App 扫码分享
分享
评论
2
打赏
  • 复制链接
  • 举报
下一条:
xxl-job集程项目:1.引入依赖<dependency><groupId>com.xuxueli</groupId> <artifactId>xxl-job-core</artifactId></dependency>2.在需要使用的工程中的yml配置执行器,并在执行器中新建业务xxljob: admin: addresses: http://localhost:8888/xxl-job-admin executor: appname: leadnews-admin-executor //创建执行器 port: 9999 在xxl-job调度中心创建调度任务的设置执行器名称,Cron(时间单位7位数设置时间) 设置Jobhandler名称这个要与第五步中的注解内部的内容相同3.创建配置类:类上@Configuration成员变量 @Value("${xxljob.admin.addresses}")@Beanpublic XxlJobSpringExecutor xxlJobExecutor() {log.info(">>>>>>>>>>> xxl-job config init."); XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); //这三个成员变量中用@value注值引用 xxlJobSpringExecutor.setAdminAddresses(adminAddresses); xxlJobSpringExecutor.setAppName(appName);xxlJobSpringExecutor.setPort(port); xxlJobSpringExecutor.setLogRetentionDays(30);return xxlJobSpringExecutor;}4.创建调度调度任务,定时审核@Component可以通过fengin接口调用 @Autowired,private WemediaFeign wemediaFeign;5.在方法上加注解@XxlJob @XxlJob("wemediaAutoScanJob")
立即登录