One Star

Loop/Retry tPOP compenent on connection error

Hello,
I have created a Talend Job in TOS 4.0.1 that connects to various e-mail accounts using the tPOP component and downloads the emails locally, fairly simple and straight forward.
The problem that I am encountering is that the tPOP component errors out if there is a connection failure or timeout, and the TOS job quits. What I would like to do is have the job not quit, but rather retry the POP connection a few more times or until it is successful, however when I try to do processing to catch the error based on component error, the job still quites. I also noticed that TOS does not easily allow you to loop back to an earlier part of the process flow.
So basically, I would like to catch the tPOP component error. If the error has to do with authentication, ssl handshake, etc., move on to the next e-mail account in the list to process, but if the error is a connection timeout then retry the connection for the account that just failed.
I appreciate any suggestions, recommendations, or insights on the best way to go about handling this.
I hope this makes sense and that someone can help. Please let me know if you require further details.
Thanks,
Tim.
6 REPLIES
One Star

Re: Loop/Retry tPOP compenent on connection error

I'm interested in doing the same thing, but I'm using tFileFetch instead of tPOP. Any solutions?
Community Manager

Re: Loop/Retry tPOP compenent on connection error

Hello
Put the tPop process into a child job, use a tRunJob to call the child job in father job, uncheck the box 'die on error' on tRunJob. eg:
father job:
tFileInputDelimited---main--->tFlowToIterate--iterate---tRunJob
child job:
tPop
tFileInputDelimited: read all the account from a file
tFlowToIterate: iterate each account
tRunJob: call the child job, pass each account to child job by context variable(see 1654).
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Loop/Retry tPOP compenent on connection error

Hello,
I have a slightly differnent requirement for the retry loop. My requirement is: When a child job fails, try again. If it succeeds after retry, report the whole Father job as success. If not, try again. If the child job still fails after these 3 tries, report Failure. Otherwise, report success.
By uncheck "die on error", the child job gets executed 3 times. However, if all 3 tries fail, the exit code is still 0. I want to know how I can set the exit code to 1 (report error) after the 3 failed attempts.
Thanks for your help.
C. Long
Community Manager

Re: Loop/Retry tPOP compenent on connection error

Hi
However, if all 3 tries fail, the exit code is still 0. I want to know how I can set the exit code to 1 (report error) after the 3 failed attempts.

You can use a tDie component to customize an error code.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Loop/Retry tPOP compenent on connection error

shong,
Thanks for the response.
C. Long
Six Stars

Re: Loop/Retry tPOP compenent on connection error

Hello,
Has anyone tried extracting emails from other mail boxes like "SENT MAIL"/"TRASH"/etc. using IMAP configuration in tPOP3 component?
Please let me know if anyone has succeeded doing this using TALEND Components.
Thanks,
Jagadish.