I'm new to Talend and need an example job to implement tLoop
. I want to run a job 10 times if it fails. I've looked at the documents, but I can't seem to figure this out.
相关问题
- tRest and map JSON with tExtractJSONField with TAL
- Talend: How to import this csv file in SQL?
- talend - parameterized tOracleInput query and nami
- Add context parameters to Talend job in Tac via AP
- Casting date in Talend Data Integration
相关文章
- Loop through all schemas in Talend
- How can I convert local time to UTC and vice versa
- Extract leaves from JSON file with JSONpath
- How to Guess schema in Mysqlinput on the fly in Ta
- Talend - Limit Number of Rows Processed
- Expose Talend ETL Job as a Web Service
- How to add third party libraries to Talend project
- Access a “String Array” from tExtractXMLField (XML
This answer has 2 sections
Creating a loop with tJava
Retying a failed connection to a data source 5 times (with adding tJavaFlex)
___________________________________
SECTION 1 : Creating a loop with tJava
-----------------------------------------------------------
I just write a tJava component and then iterate to false. Like this
Step 1: create a context variable
Step 2: write some java code in tJava (tJava1)
then connect
On Component Ok
Step 3: Create the tLoop
in the loop condition put your context
context.continueLooping
which should be true by the first iteration.then iterate
to the next tJava (tJava2)
this tJava runs different code for each iteration till it reaches 5 I use this area to count stuff and load value to other contexts and more.
Then it runs the nest part n times till the context value is set to false.
___________________________
SECTION 2 : TO Retry Failed Connections
___________________________
if you need to retry a DB connection.
add a tJavaFlex between tLoop1 and tJava2 like so
and add the following code in the 3 sections Start:
Main:
End:
and add
On Component Ok
tJava
with the code to stop looping on the success (tJava3)