yudaocode / SpringBoot-Labs

一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

定时任务 xxl-job 的配置不对

yuyong725 opened this issue · comments

commented

问题如:xuxueli/xxl-job#1339 ,2.1.1的版本要注释掉bean的描述,不然启动会报错java.net.BindException: Address already in use,芋艿细心点可好

@Bean //(initMethod = "start", destroyMethod = "destroy")
    public XxlJobSpringExecutor xxlJobExecutor() {
        // 创建 XxlJobSpringExecutor 执行器
        XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
        xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
        xxlJobSpringExecutor.setAppName(appName);
        xxlJobSpringExecutor.setIp(ip);
        xxlJobSpringExecutor.setPort(port);
        xxlJobSpringExecutor.setAccessToken(accessToken);
        xxlJobSpringExecutor.setLogPath(logPath);
        xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
        // 返回
        return xxlJobSpringExecutor;
    }

好滴。fix 了。

不影响跑。哈哈哈,我直接贴了以前 onemall 的配置了。

这是因为第一次注册过,而且以后不改配置信息的前提。