One Star

Call talend task from scripts - queston

Hi,
I have a question about call task with metaServlet script:
when I run task from TAC, the task will immediately run without any delay.. that is good.
But when I run it using script as below:
MetaServletCaller.bat -url $TACUrl --json-params={""actionName"":""runTask"",""authPass"":""$passwordText"",""authUser"":""$username"",""mode"":""synchronous"",""taskId"":""$taskId""} 
to run task, it will always cost several minutes to Requesting running and then running...
can we skip requesting running step?
we have requirement to schedule the task to run every 2 minutes, will met problems because of this.
Please let me know if you have any thoughts..
Thanks in advance!
8 REPLIES
Seventeen Stars

Re: Call talend task from scripts - queston

What release do you run. In the release 5.4.2 I haven't seen this issue. I know this issue from older releases like 5.1.x.
Perhaps you try to run the task asynchronously, this is what happened if you click on run in the TAC.
If you have problems figuring out the task status you could use the custom component tRunTask from Talend Exchange - here this is solved.
One Star

Re: Call talend task from scripts - queston

thanks, jlolling
we are using 5.3.1.
unfortunately, we have run it using batch scripts to call job from outside because of the business logic....
Seventeen Stars

Re: Call talend task from scripts - queston

I have similar requirements and thats because I created the component to call a task in the TAC from a Talend job which could also run in the TAC or simply is called by an external program.
Could you please test if you experiences the same delay if you use the asynchronous mode?
One way to solve such delays is to check the queries from the TAC to your TAC database. Sometimes the database lacks some essential indexes. I had to add some in the release 5.4.2 for execution plans to get them running fast.
It depends on your database. I suggest you make a call to the support because a delay in the minute range is far from normal. 
Please take also in account the refresh of the task view in the TAC web app is not very fast and far from being real time if the status is changed from outside the TAC.
One Star

Re: Call talend task from scripts - queston

Thanks!
Yes, I tested it with mode = asynchronous. no progress, and it brings more trouble... because we scheduled to call it every 2 minus, asynchronous will cause a lot of awaiting exec because of the delay.
we have 45 tasks which will be called from outside every 2 minus, maybe this will also cause this issue.. I can always see blocked status data in quartz table.
Anyway, we will call Talend Support for help. thank you.
Seventeen Stars

Re: Call talend task from scripts - queston

Yes of course it is not the solution in your design. It have seen sometimes differences here but anyway...
What about checking the statements fired from the TAC to the database (which database do you use here?). 
One Star

Re: Call talend task from scripts - queston

I am using sql server 2008.
what do you mean "What about checking the statements fired from the TAC to the database" ? I am not sure where to check..
Seventeen Stars

Re: Call talend task from scripts - queston

I would use the Microsoft DB tools and check if some queries takes to long and need optimisation.
I would check the statements which are in the top-10 of the most expensive statements on this database.
One Star

Re: Call talend task from scripts - queston

Oh, thanks, got the meaning. Smiley Happy