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

1 ACCEPTED SOLUTION

Accepted Solutions
Fifteen Stars

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.

 

Rilhia Solutions
5 REPLIES
Four 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

Forteen Stars TRF
Forteen 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
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

Fifteen Stars

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.

 

Rilhia Solutions
Four 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