How to email Talend job error information in Talend Open Studio Data Integration
Send email Talend job error information by using tSendMail
We learned about basic error handling in Talend Open Studio Data Integration at the following article.Basic Error Handling in Talend Open Studio Data Integration
In this article, we are going to learn how to email Talend job error information.
[Related posts]
How to email Talend job error information in Talend Open Studio Data Integration
Create a new job which causes database connection error
In order to send an email with job error information, we are going to create a job which connects to Oracle database. We just need to cause database connection error, we don't need to create or prepare Oracle database.As the following image, we need to place tOracleConnection component and tOracleInput component, then tOracleConnection needs to link to tOracleInput (OnComponentOK)。
Also, we need to place tLogCatcher component and place tSendMail component as follows. tLogCatcher catches Talend job error and tSendMail component sends an email. Both are great component.
As a result of that, each component are placed as follows.
In order to cause database connection error, we need to put a dummy IP address in tOracleConnection component (We set 10.10.10.10 for the Host setting), so that we can cause database connection error.
Configure tSendMail component to send an email with error information
When Oracle database connection failed, tLogCatcher component catches the error. tLogCatcher has various error information, but we use only the following information in this article.- job ===> Job Name
- origin ===> Component name which caused an error
- message ===> Error Message
If we can see the above error information in email, we should be able to figure out what happened.
In order to put the error information, we need to configure "Message" field in tSendMail component as the following image. The reason why we need to use "+" sign is that Talend is written in Java and require Java expression.