You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
main方法
public static void main(final String[] args) {
ZookeeperConfiguration zkConfig = new ZookeeperConfiguration("localhost:2181", "cy-job", 1000, 3000, 3);
CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(zkConfig);
regCenter.init();
JobConfiguration jc1 = new JobConfiguration("999", SimpleJobDemo.class, 3, "0/10 * * * * ?");
jc1.setShardingItemParameters("0=a,1=b,2=c");
new JobScheduler(regCenter, jc1, new OnceJobListener(1000, 10000)).init();
}
监听使用的是仅单一节点执行的监听
public class OnceJobListener extends AbstractDistributeOnceElasticJobListener {
public OnceJobListener(long startedTimeoutMilliseconds, long completedTimeoutMilliseconds) {
super(startedTimeoutMilliseconds, completedTimeoutMilliseconds);
}
@OverRide
public void doBeforeJobExecutedAtLastStarted(JobExecutionMultipleShardingContext shardingContext) {
System.out.println("任务执行前监听");
}
@OverRide
public void doAfterJobExecutedAtLastCompleted(JobExecutionMultipleShardingContext shardingContext) {
System.out.println("任务执行后监听");
}
}
启动job
监听日志正常输出
修改分片参数
我是在监控平台帮分片修改为1,分片序号修改为0=a,保存。
控制台监听报异常
[JOB] 2016-05-18-22:26:23.486 [DEFAULT.999_Scheduler_Worker-1] ERROR c.d.d.j.p.j.t.s.AbstractSimpleElasticJob - Elastic job: exception occur in job processing...
com.dangdang.ddframe.job.exception.JobTimeoutException: Job timeout. timeout mills is 10000.
at com.dangdang.ddframe.job.api.listener.AbstractDistributeOnceElasticJobListener.afterJobExecuted(AbstractDistributeOnceElasticJobListener.java:99) ~[elastic-job-core-1.0.6.jar:na]
at com.dangdang.ddframe.job.internal.schedule.JobFacade.afterJobExecuted(JobFacade.java:225) ~[elastic-job-core-1.0.6.jar:na]
at com.dangdang.ddframe.job.internal.job.AbstractElasticJob.execute(AbstractElasticJob.java:68) ~[elastic-job-core-1.0.6.jar:na]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.2.2.jar:na]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.2.jar:na]
[JOB] 2016-05-18-22:26:23.492 [DEFAULT.999_Scheduler_Worker-1] DEBUG c.d.d.r.e.RegExceptionHandler - Elastic job: ignored exception for: KeeperErrorCode = NoNode for /cy-job/999/offset/0
The text was updated successfully, but these errors were encountered:
terrymanu
changed the title
1.0.6版本,修改分片参数后,导致仅单一节点执行的监听报异常
[Bug] 1.0.6版本,修改分片参数后,导致仅单一节点执行的监听报异常
May 19, 2016
资源: 1台服务器(job和zk在一起), 不能发图我就发代码了。
代码如下:
public static void main(final String[] args) {
ZookeeperConfiguration zkConfig = new ZookeeperConfiguration("localhost:2181", "cy-job", 1000, 3000, 3);
CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(zkConfig);
regCenter.init();
}
监听使用的是仅单一节点执行的监听
public class OnceJobListener extends AbstractDistributeOnceElasticJobListener {
public OnceJobListener(long startedTimeoutMilliseconds, long completedTimeoutMilliseconds) {
super(startedTimeoutMilliseconds, completedTimeoutMilliseconds);
}
@OverRide
public void doBeforeJobExecutedAtLastStarted(JobExecutionMultipleShardingContext shardingContext) {
System.out.println("任务执行前监听");
}
@OverRide
public void doAfterJobExecutedAtLastCompleted(JobExecutionMultipleShardingContext shardingContext) {
System.out.println("任务执行后监听");
}
}
启动job
监听日志正常输出
修改分片参数
我是在监控平台帮分片修改为1,分片序号修改为0=a,保存。
控制台监听报异常
[JOB] 2016-05-18-22:26:23.486 [DEFAULT.999_Scheduler_Worker-1] ERROR c.d.d.j.p.j.t.s.AbstractSimpleElasticJob - Elastic job: exception occur in job processing...
com.dangdang.ddframe.job.exception.JobTimeoutException: Job timeout. timeout mills is 10000.
at com.dangdang.ddframe.job.api.listener.AbstractDistributeOnceElasticJobListener.afterJobExecuted(AbstractDistributeOnceElasticJobListener.java:99) ~[elastic-job-core-1.0.6.jar:na]
at com.dangdang.ddframe.job.internal.schedule.JobFacade.afterJobExecuted(JobFacade.java:225) ~[elastic-job-core-1.0.6.jar:na]
at com.dangdang.ddframe.job.internal.job.AbstractElasticJob.execute(AbstractElasticJob.java:68) ~[elastic-job-core-1.0.6.jar:na]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.2.2.jar:na]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.2.jar:na]
[JOB] 2016-05-18-22:26:23.492 [DEFAULT.999_Scheduler_Worker-1] DEBUG c.d.d.r.e.RegExceptionHandler - Elastic job: ignored exception for: KeeperErrorCode = NoNode for /cy-job/999/offset/0
The text was updated successfully, but these errors were encountered: