xxl-job springboot bean 配置类 配置 @Bean(initMethod = "start", destroyMethod = "destroy") 导致执行器注册两次

gwo2fgha  于 2022-04-21  发布在  Java
关注(0)|答案(0)|浏览(219)

Please answer some questions before submitting your issue. Thanks!

Which version of XXL-JOB do you using?

2.3.0

Expected behavior

实际应该注册一个
这里只有两个节点,却注册了四个节点。两个两同ip不同端口

Actual behavior

只注册两个节点

Steps to reproduce the behavior

@bean(initMethod = "start", destroyMethod = "destroy")
public XxlJobSpringExecutor xxlJobExecutor() {
logger.info(">>>>>>>>>>> xxl-job config init.");
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
xxlJobSpringExecutor.setAppname(appname);
xxlJobSpringExecutor.setAddress(address);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);

return xxlJobSpringExecutor;
}

Other information

虽然不应该配置 initMethod = "start",但我觉得应该对用户更为透明化,不然排查起来不好排查

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题