Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

gusto2
2012-05-25 11:38:49

Hi Ed,

I've never been fond of socket communication, but you are right, Mina looks effective for this use case.
Thankx a lot.
      Gabriel

eost
2012-05-24 22:09:16

You can find a sample job and a corresponding route on my site at http://eost.net/eost/jobAdaptor/socketPipeJob.zip .

Note that in order to use the Camel MINA component you need to use the cConfig element to add the dependency.

http://eost.net/eost/jobAdaptor/cConfigForMINA.png

Note that the Camel route shown below uses a glorified sticky note just to represent the Job.  It's just for show.  The real elements doing the work implemented with tMessageEndpoint and the appropriate Camel Mina uri.  you can find more information on how to specify that uri in the Talend Integration Factory User's Guide, or online at http://camel.apache.org/mina.html

http://eost.net/eost/jobAdaptor/camelRouteInvokingJobViaSocket.png

Note that the DI Job uses tSocket as documented in the Talend Component Reference Guide which you can download from our site.  When you run this in Studio, start the Camel client first.  It will keep trying to (recoonnect) until you start the Job.  Note that by default the DI job will end after processing one request unless you put it in a loop.  In contrast, if you did the same thing with tMOM for your job you could specify "Keep Listening" in the component view.

http://eost.net/eost/jobAdaptor/tSocketJob.png

gusto2
2012-05-24 20:20:20

Hi Edward,

that's an answer too. If there's no direct approach, JMS is a very good way to return data.
Thanks for the prompt reaction.

Carpe diem
          Gabriel

eost
2012-05-24 19:57:59

One way is to use a tSocket connector on the job side and a camel-mina component on the other side.  Alternatively you could use JMS with tMOM on the job side and the cJMS on the route side.  I'll post a link to an example later.

gusto2
2012-05-24 10:36:08

Hi,

another related question - maybe it is simple and I am not aware of it..
is there a simple way to get data back from the integrated "in-route" job?
In theory - I can create a web service from a job and invoke the job as a service. But if there's a simple way to synchronously call the job, maybe there's a way to get data back (something like using tBufferOutput) like between Talend jobs..

Thankx in advance
         Gabriel

bschuhmann
2012-04-26 15:38:43

Hi Valery,

vdetez wrote:

- Why those type of basic actions are not documented somewhere?  effectively integrate a route with a job is the added value of the product.  Why is it so difficult to find doc about it?

We're writing doc, just need to ask for a bit more patience wink

vdetez wrote:

The product is it mature enough?

It is. Test it and I'm confident it will work for you.

vdetez wrote:

- by reading doc, I found that we have to use config object to define librairies.  Why do we have to do it?  effectively when I am importing the Jar job file, all those required librairies are already it the Web-inf/lib directory?

Give 5.1 RC1 a try, I know we're working on it and it might already be fixed. Dependency resolution is not trivial (especially with the different runtime environments) and we though even with this snag, cTalendJob is already useful.

Schaefer.Al
2012-04-26 13:12:30

Hello all.

Many many thanks for the short description of how to pass arguments from a route to a job.

This was the piece of glue I was looking for the last few month.

Regards,
Alexander.

vdetez
2012-04-25 15:01:31

Hi guy's

it's so simple when you speak with person who knows the product.

@bschuhmann,

As I can see you work for Talend.  So I have some question for you.
- Why those type of basic actions are not documented somewhere?  effectively integrate a route with a job is the added value of the product.  Why is it so difficult to find doc about it?
The product is it mature enough?

- by reading doc, I found that we have to use config object to define librairies.  Why do we have to do it?  effectively when I am importing the Jar job file, all those required librairies are already it the Web-inf/lib directory?

Thks for your help.  Now it's more clear

Valery

gusto2
2012-04-25 14:27:32

Hi,
that is a great help even for me, thanks smile

Gabriel

bschuhmann
2012-04-25 12:30:50

hi valery,

here's what you need to pass the filename from the Camel route to the job:

1) in the job you need a context variable, e.g. filename - I assume you have that already

2) create a Camel route like the one attached

http://www.talendforge.org/forum/showimage.php?pid=83538&filename=route.png

3) cTalendJob passes all Camel headers to the job, so you need to set a header that has the same name as the context variable in your job, e.g. filename - see the next screenshot for how to configure a cSetHeader

http://www.talendforge.org/forum/showimage.php?pid=83538&filename=settings.png

4) if the job you want to start from the route requires additional JARs that are not yet on the classpath, you need an additional cConfig to add the external dependencies. I needed talend_file_enhanced_20070724.jar for a tFileInputPositional.

http://www.talendforge.org/forum/showimage.php?pid=83538&filename=cconfig.png


let me know if this is what you needed and works for you?

hth

bernhard

gusto2
2012-04-25 11:42:46

Hi,
I don't want to dissapoint you, but seems even the TOS supports to add the tJob icon to the route model, it doesn't work - neigther for me. In some docummentation or one of forum contributions I found that this feature still needs to be developed (I use TOS 5.0.2).

As a solution - we exposed our jobs as services or mroe often - let them listen on their queues, and then from mediation route (Camel) or eny external application we send a message to the job queue for processing or call the job's web service.

so - in the route send the file content or the file name - cFile-->cMessageEndpoint   and than have a job tMomInput->process the message

Couldn't find anything better sad

Gabriel

vdetez
2012-04-25 11:11:31

Can Someone help me?

thks

valery

vdetez
2012-04-24 11:34:01

hi

I have a job :
- tFileInputDelimited -> tMap -> TAdvancedFileOutputXml just for a transformation

I export this jar file and reimport it as a TalendJob in a route
In this route I would like to files arriving in a cFile and tFileInputDelimited that I have in my job.
So from a cFile, launch a route.

how could I do it?

thks

Valery

Board footer

Powered by FluxBB