How to stop the worker, if job has not complete

Hi All,

I want to stop the worker, when job has got failed. Is there any feature like set timeout to stop worker?
I am using zeebe 0.17.0

Thanks,
Guna P

Hi @Guna,

please describe your use case. Why do you want to stop the job worker?

Currently, if a job fails then it is retried until its retries <= 0. The retry happens immediately after the failure.
Do you want to configure when the job is retried? For example, retry the job in one minute. If yes then look at the open feature request: https://github.com/zeebe-io/zeebe/issues/164

BTW: you should update to the latest Zeebe version 0.21.1.

Best regards,
Philipp

1 Like

Hi @philipp.ossler,

Thank you for the reply.

my use case:
The Job is pulling data from database, if found data then the test case is passed otherwise it’s failed.
for example, my test case is failed, means i am not getting data from db.
now the Zeebe worker has to be stop, if no data found from db after sometime, but in my case the worker polled every seconds ( I know in Zeebe by default 1s ).

I am expecting, Zeebe worker wait for sometime, after that reach the timeout it should stop.

Thanks,
Guna P

Hi @philipp.ossler,

I am using the above scenario is for Junit testing and ZeebeTestRule is my client object.

Thanks,
Guna P

Hi @Guna,

Use 0.21 with long-polling workers: https://zeebe.io/blog/2019/08/long-polling/

Do you want to stop the worker polling Zeebe or stop it polling the database?

Josh

Hi @jwulf,

Ok, I will use 0.21.

I want to stop the worker polling Zeebe.

Thanks,
Guna P

Hi @jwulf,

Now i am using zeebe-client-java 0.21.0 version and zeebe-test 0.21.0, but ZeebeTestRule.clsss is not supporting Java 1.8

Please advise me.

Thanks,
Guna P