Handle JOB_NO_RETRIES tasks

I have some tasks with state (JOB_NO_RETRIES) and I whant to complete them or handle again. In documentation https://stage.docs.zeebe.io/reference/incidents.html I saw the solution:

client.newUpdatePayloadCommand(incident.getElementInstanceKey())
    .payload(NEW_PAYLOAD)
    .send()
    .join();

client.newUpdateRetriesCommand(incident.getJobKey())
    .retries(3)
    .send()
    .join();
        
client.newResolveIncidentCommand(incident.getKey())
    .send()
    .join();        

But how I can get the incident?

Hi @slava.aleferov,

you can get the incidents by implementing an exporter. There is no client request to get the incidents directly from the broker.

The idea is that incidents are solved by user interaction. This could be done, for example, using the Zeebe simple monitor.

Does this make sense for you?

Best regards,
Philipp

1 Like

Thank you, it’s clear. It turns out that the Zeebe remains very lightweight and we ourselves must monitor the execution context. Would you recommend open-source projects on Zeebe to see how to work with it correctly?

I don’t know real projects which uses Zeebe yet. Zeebe is still new and in pre-production state. However, you can have a look at the following projects:

If you have questions how to use a feature or do something with Zeebe, feel free to ask :wink:

Thank’s! I have already seen this projects)

Hi @philipp.ossler,

How can i implementing an exporter to get the incidents ? Please provide some sample java.

how to create incident from java client side? when business logic failed I have to raise the incident with my custom message.

Thanks

Hi @Guna, creating an exporter: https://zeebe.io/blog/2019/05/exporter-part-1/

To raise an incident, fail the job and set the retries to 0. See: https://github.com/zeebe-io/zeebe/blob/e2fed8bc7d15092deb701cba5f0b158d250c2485/clients/java/src/main/java/io/zeebe/client/api/clients/JobClient.java#L62