Talend Components Asynchronous Behavior

Highlighted
Seven Stars

Talend Components Asynchronous Behavior

Hi,

 

It seems that Talend components execute in asynchronous manner. For this please have a look at the attached job design.

 

In the last component (tjava_2) as shown in attachement I have simply printed some variable value. E.g. String foo = "bar";

System.out.println(foo);

 

When I start the job I noticed that this variable “foo” value gets printed first even when the job is still executing. Does this means that all Talend compnents (connectors) work in asynchronous fashion? If this is true is it possible to change this asynchronous behavior to synchronous behavior?

 

Regards

Tarunjit Singh


Accepted Solutions
Highlighted
Community Manager

Re: Talend Components Asynchronous Behavior

@TRF is correct. I would go further and say that the tJava should not be used connected to a "row" like this and that you should use it only with OnSubJob or OnComponent links. However, you *can* use it like this, so should use it knowing that components that process rows either side will be run synchronously, while the tJava will be run at the beginning of the SubJob.

 

View solution in original post


All Replies
Highlighted
Six Stars

Re: Talend Components Asynchronous Behavior

I didn't saw such behavior yet, could you please send the log as well and make sure that you don't have same java code in any other java component.

 

Regards,

Ajinkya

Highlighted
Sixteen Stars
Sixteen Stars

Re: Talend Components Asynchronous Behavior

Hi,
This a normal behavior.
tJava component starts first and run only once for a subjob.
You may refer to this link https://umeshrakhe.wordpress.com/2015/03/02/difference-between-tjavatjavarowtjavaflex/ or the official documentation.

TRF
Highlighted
Seven Stars

Re: Talend Components Asynchronous Behavior

Hi,

 

By normal behavior you mean the normal behavior of tJava component.

Otherwise all componets (connectors) behave in synchronous fashion?

 

Regards

Tarunjit Singh

Highlighted
Community Manager

Re: Talend Components Asynchronous Behavior

@TRF is correct. I would go further and say that the tJava should not be used connected to a "row" like this and that you should use it only with OnSubJob or OnComponent links. However, you *can* use it like this, so should use it knowing that components that process rows either side will be run synchronously, while the tJava will be run at the beginning of the SubJob.

 

View solution in original post

Highlighted
Six Stars

Re: Talend Components Asynchronous Behavior

Thanks @TRF . I agree @rhall_2_0, I didn't noticed that java_2 is connected using row_main. I considerd it would be connected using onComponentOk or OnSubJobOk

 

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