How can I restart my job automatically when any errors happen ?

One Star

How can I restart my job automatically when any errors happen ?

In Talend Open Studio, let's say I have an input connector to a DB (whatever DB), and when there is an error connecting to the DB I would like the job to restart again (immediately or after X seconds).
So far what I am able to do is that I am able to catch the error with a tAssertCatcher component and I am able to send an email when this happens with the tSendEmail component. However, once I catch this error I would also like to try again to connect to the DB but I don't know how. Maybe I don't know how to do it but Talend does not allow to loop back to the input connector of the DB.
Question2:
I heard that there something possible to be done with the Enterprise version, by adding checkpoints. But with that mechanism, is it possible for the job to restart automatically?
Thanks in advance for your help!
One Star

Re: How can I restart my job automatically when any errors happen ?

Hi pcollette,
If you want your job to start again in the Talend client i.e., the UI then try this
tInfiniteLoop (set some time) --------> tIterateToFlow --------> tRunJob
Where tRunJob is your sub job which does the input db connection and logic. This way even if your job (tRunJob) fails, it will loop back, wait for few seconds and re run the job again.
Hope this helps.
G
One Star

Re: How can I restart my job automatically when any errors happen ?

Hi pcollette,
If you want your job to start again in the Talend client i.e., the UI then try this
tInfiniteLoop (set some time) --------> tIterateToFlow --------> tRunJob
Where tRunJob is your sub job which does the input db connection and logic. This way even if your job (tRunJob) fails, it will loop back, wait for few seconds and re run the job again.
Hope this helps.
G

Thanks for the reply!
So that would mean I would need to create 2 separate jobs? One job for the DB connection+logic and one connection with the loop?
However how would it be possible for the job to stop once it didn't get any errors?
One Star

Re: How can I restart my job automatically when any errors happen ?

Yes, you will need to create two different job.
You certainly will not be able to loop back and the only option is to run the job manually again or schedule your job in Windows Scheduler or the TAC or run an infinite loop.
Or another option is, on an empty job, drag your data connection+ logic job twice, and connection your job1 to job2 with OnSubJobError.
And why do you think your connection will fail anyways?
G
One Star

Re: How can I restart my job automatically when any errors happen ?

.....
And why do you think your connection will fail anyways?
G

I am actually using the GoogleBigQuery input connector and sometimes the connection(web service) fails or is unavailable for some reason. Since there is no logic to retry to connect to the DB in the connector, I need to build some kind of retry mechanism.
Would I be able to do something like this with the Enterprise version?