Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

springboot一个服务配置多个xxljob执行器启动失败 #3611

Closed
mezwl opened this issue Jan 2, 2025 · 1 comment
Closed

springboot一个服务配置多个xxljob执行器启动失败 #3611

mezwl opened this issue Jan 2, 2025 · 1 comment

Comments

@mezwl
Copy link

mezwl commented Jan 2, 2025

Please answer some questions before submitting your issue. Thanks!
在yml中配置一个执行器启动正常,但我配置第二个时项目就无法启动,经跟踪源码发现执行器会去扫描所有加了@xxljob注解的方法,但我方法明确定义了对应的执行器,这就造成第一个执行器将加了@xxljob注解的方法扫描后放入了ConCurrentHashMap中,另一个执行器又去扫描发现已经存在然后就直接抛异常 启动失败
异常信息为:java.lang.RuntimeException: xxl-job jobhandler[myjobhandler_test1] naming conflicts.
yml配置:
xxl:
job:
admin:
addresses: http://127.0.0.1:8091/xxl-job-admin
executor1:
appname: xxl-job-executor-test1
ip:
port: 9999
logpath: D:/data/applogs/xxl-job/jobhandler1
logretentiondays: 30
accessToken: default_access_token
executor2:
appname: xxl-job-executor-test2
ip:
port: 9998
logpath: D:/data/applogs/xxl-job/jobhandler2
logretentiondays: 30
accessToken: default_access_token
困扰了好几天,有没有大佬帮忙解惑下,感激不尽

Which version of XXL-JOB do you using?

Expected behavior

Actual behavior

Steps to reproduce the behavior

Other information

@xuxueli
Copy link
Owner

xuxueli commented Jan 5, 2025

建议配置一个

@xuxueli xuxueli closed this as completed Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants