Nazgul
Nazgul

Reputation: 1902

Mule ESB - design a multi file processing flow when files are dependent on each other

Okie...I am aware of Datamappers, Batch and streaming support in File inbound elements. What i want to know is the design pattern for integration when:

How do you folks propose to design this using Mule ESB. I know about designs for a single CSV. Using the batch flows, you read the file in using a streaming file connector, then use a streaming data mapper to extract data and then transform the data into VOs and put in DB. This is straight forward. Adding batch-commit here at DB insert level or the whole setup improves performance also. But what to do when you have multiple files as i said in my scenario?

Upvotes: 0

Views: 1598

Answers (1)

David Dossot
David Dossot

Reputation: 33413

This has been asked on StackOverflow several times, with different wording. Usually the answer is to have a file inbound-endpoint pick one of the many files and then pick the other files down in the flow with a requester.

See: https://github.com/mulesoft/mule-module-requester

In your case, the main file would be available as an input stream while the images and prices lookup files would be loaded in memory (in Maps for ex) so you can access them quickly when processing the main stream.

Upvotes: 2

Related Questions