Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Prasanna3
Contributor
Contributor

Scenario based Question in Talend???

How can I stop a job after 3 failures in talend?
Labels (2)
1 Solution

Accepted Solutions
Jesperrekuh
Specialist
Specialist

Isn't 1 failure just enough?  Except time outs ... File not there yet ... kinda time-based related things.

But 3 Is just planning for more failure and is 'bad' design. 3 sounds arbitraty, why not 4 or 5 ...  I dont get this type of reasoning. Why please elaborate?

 

Possible solution:

OnComponentError / OnSubJobError  ----> tJava 

// check if exists
Integer  cnt =(Integer) globalMap.get("error_counter");
if cnt != null {
cnt ++; 
globalMap.put("error_counter", cnt );
if cnt.equals(3)  { 
// raise exception to make sure it dies...
  throw new Exception(); 
  }
}else { globalMap.put("error_counter", 1 ) ; }

after tJava a tDie/tWarn component to do whatever you want to do ... 

 

View solution in original post

6 Replies
fdenis
Master
Master

add an other job who call your job using 3 tRunJob and link tRunJob by onComponentError.

It's Done.
Regards
Prasanna3
Contributor
Contributor
Author

Can you please provide me complete job design ?
fdenis
Master
Master

it is complete.
create a new job.
slide jour job inside 3times. (it will add 3 trunJob components)
link your 3 trunjob using onComponentError
Regards,
Jesperrekuh
Specialist
Specialist

Isn't 1 failure just enough?  Except time outs ... File not there yet ... kinda time-based related things.

But 3 Is just planning for more failure and is 'bad' design. 3 sounds arbitraty, why not 4 or 5 ...  I dont get this type of reasoning. Why please elaborate?

 

Possible solution:

OnComponentError / OnSubJobError  ----> tJava 

// check if exists
Integer  cnt =(Integer) globalMap.get("error_counter");
if cnt != null {
cnt ++; 
globalMap.put("error_counter", cnt );
if cnt.equals(3)  { 
// raise exception to make sure it dies...
  throw new Exception(); 
  }
}else { globalMap.put("error_counter", 1 ) ; }

after tJava a tDie/tWarn component to do whatever you want to do ... 

 

Prasanna3
Contributor
Contributor
Author

My question is.

I want to kill the job after 3 times failed.
Can I implement that without writing tjava code
Jesperrekuh
Specialist
Specialist

Yes but its very inefficient like :
tRunJob --> OnComponentError -->tRunJob --> OnComponentError -->tRunJob --> OnComponentError --> tDie
This is what @fdenis is suggesting but doesnt take into account a specific component where you want to set a limit of errors.

There should be some sort of error count within Talend ... and within tDie and tWarn ... die after max threshold