tDie component doesn't kill the job

Highlighted
One Star

tDie component doesn't kill the job

I have a very simple process as follows
******************************************************************************************************
prejob --> OnComponentOk --> tOracleConnection --> OnSubJobError --> tSendMail_1 --> OnComponentOk --> tDie_1
|
OnSubJobOk
|
tFTPConnection --> OnSubJobError --> tSendMail_2 --> OnComponentOk --> tDie_2

tSendMail_3
******************************************************************************************************
I have the tSendMail_3 sitting alone to test if the tDie process kills the process or not.
I purposefully put in the wrong password for the tFTPConnection, and I can see the message from tDie_2 in the log, but the process does not get killed and I still get the email from tSendMail_3.
I saw the thread http://www.talendforge.org/forum/viewtopic.php?id=9613 but, I do not want to use 'Exit JVM' option, but also do not know how to code the tJava component.
Please help!
Highlighted
One Star

Re: tDie component doesn't kill the job

Hi,
Your tSendMail_3 is linked to no component, so when your job is running it makes a parallel exeuction, meaning both of the "subjob" are exectuing. If your tSendMail_3 is supposed to be used when all the treatement have passed, link it with a onSubJobOk and then the mail will be only send when all the treatments have successed. Furthermore your process is not killed because you don't use a tcatcher component, you need to use it to catch the log, the job will be killed when the message is treated by the tcatcher.
If your need to send a mail when there is an error in your job, try as follow:
prejob --> OnComponentOk --> tOracleConnection
|
OnSubJobOk
|
tFTPConnection
|
OnSubJobOk
|
tsendMail_3(success!)
tlogcatcher---->tsendmail_1(fail....)
I only use tlogcatcher to send me a mail when my job fail (with no tdie), always worked Smiley Happy. But of course you can put tdie compoennt if you want !
Highlighted
One Star

Re: tDie component doesn't kill the job

Or3l,
Thanks for your reply.
I did not try the tLogCatcher, but linking the tSendmail_3 to the main job works, however, I would imagine that since the tDie is in the Prejob, the processes after PreJob would not run, if error occurs in PreJob. I guess that is not how it is designed to work?

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog