One Star

How to send multiple files to Mediation Route via tRouteOutput

I have as input an xml file and after doing the processing i have to create multiple files based on the input file's content.
I have been able to create multiple files locally in Data integration Job.
However after connecting the Data integration Job to the Mediation Route i am unable to send each file created to the Mediation Route.
Only the last file is being sent.
What i want as output is that each file is sent to the Mediation Route.
Please note that i used tHashOutput and tHashInput because i don't want to store the files physically in a directory.
Can anyone please help me?
One Star

Re: How to send multiple files to Mediation Route via tRouteOutput

When calling a Talend Job from a Route, you generally send one message to the Job and receive one message back.
To satisfy your requirement, you could rewrite this Route so you create multiple outputs in the Route itself, before passing each message to your job, if you still need to transform/process it.
For example, a Route could pick up the file (cFile) and split the message (cSplitter) using an Xpath expression. You could then pass each piece of the message into a Job. See screenshot.
Or, instead of using a cSplitter, you could use a cLoop component to iterate N times, where N can be the result of any expression you want.