how to retry certain times?

One Star

how to retry certain times?

I use tRest to call web service, according to the return result , if error,retry 10 times ;else empty or has data, write to csv.
How do i design the job structure ? I am a bit confused with the different connections.
Community Manager

Re: how to retry certain times?

Hi  
Try to design the job looks like:
main job: define a context variable called condition, this variable will be used for the condition on tLoop component. 
tLoop--iterate--tRunJob--oncomponentok--tjava1
                                  --oncomponenterror--tjava2
on tLoop: set the condition field with context variable: context.condition.
on tRunJob: call the child job, check the 'die on error' option.
on tJava1:
context.condition=false;
on tJava2:
if(iteration_number<11){
context.conditon=true;
}else{
context.conditon=false;
}
child job:
tRest--main--tlogRow
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: how to retry certain times?

Thanks. Could we incorporate time also here. Actually, if rest api is down, i want to retry for 10 times but after interval of 5 mins. Can we achieve this?
Five Stars

Re: how to retry certain times?

Could you please tell what is iteration_number and where we have to define it?

Six Stars

Re: how to retry certain times?

did you got any solution, because i'm also facing same issue,
how to retry tSoap call in case on any service down/network issue for web service?

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch