Context variables:
Context describes the user-defined parameters that are
passed to your Job at runtime. Context Variables are the values that
may change as you promote your Job from Development, through to Test and Production.
Values may also change as your environment changes, for example, passwords may
change from time to time.
In Talend context variables can create two ways
- Local variables: create in job level that are only used in the corresponding job.
- Global variables: create in Talend Repository that are used in throughout project
How can we pass the Values for Context variables?
- We can hardcode the values in Talend.
- We can use tContextLoad component in each job t get the values from file.
And we have one more way to pass the values for context
variables in Talend Project. i.e. implicit
context
How to configure implicit
context in Talend?
We can configure implicit context with files or Database. If
you use file or database we need to have two Main columns i.e. key and value.
If you use table for maintain context variables. Just create
a table with two columns i.e. key and values.
CREATE TABLE `tbl_implici_context` (`key` varchar (255)
DEFAULT NULL, ‘value` varchar (255) DEFAULT NULL) ENGINE=InnoDB DEFAULT
CHARSET=latin1;
The charset should be latin1 because it should accept all
special characters.
So while loading all variables and values all values for
password fields should be encrypted. For this Encryption I have used database
encryption algorithm.
i.e. AES_ENCRYPT
and AES_DECRYPT
Create a Talend job to populate the implicit context table. For
this use case I have taken tFixedflowInput component as source.
Use tJavaRow1 component to generate insert statement
if(input_row.key.matches(".*password.*"))
{
context.username=
"insert into tbl_implici_context values('"+input_row.key+"',AES_ENCRYPT('"+input_row.value+"','mykeystring'));";
System.out.println(context.username);
}
else
{
context.username=
"insert into tbl_implici_context values('"+input_row.key+"','"+input_row.value+"');";
System.out.println(context.username);
}
Use tMysqlRow component to execute this insert statement
Run the Job
Check the Results
Configure implicit context in project settings with Decrypt
the password values.
In Talend StudioàProject
settingsà
Job settings
In the Query section we should use the Decrypt methods. Here
I have written one Query to decrypt the passwords.
Generally the Query condition option only take where clause.
"`key` not like '%password%' union
select `key`, case when `key` like '%password%' then
AES_DECRYPT(value,'mykeystring') else value
END value from
test.tbl_implici_context"
****************************THANK YOU******************************
good stuff. this is very basic, yet critical.
ReplyDeleteReally you have done a good job. Thanks for sharing this valuable information....
ReplyDeleteInformatica MDM Training in Chennai
Informatica Training in Chennai
Informatica Training in Bangalore
Talend Data Integration And Talend Mdm And Talend Big Data : How To Configure Implicit Context In Talend With Encrypt And Decrypt The Password Values >>>>> Download Now
ReplyDelete>>>>> Download Full
Talend Data Integration And Talend Mdm And Talend Big Data : How To Configure Implicit Context In Talend With Encrypt And Decrypt The Password Values >>>>> Download LINK
>>>>> Download Now
Talend Data Integration And Talend Mdm And Talend Big Data : How To Configure Implicit Context In Talend With Encrypt And Decrypt The Password Values >>>>> Download Full
>>>>> Download LINK