|
|
inbound-split-process each message
Hi,
Have a in bound file- we split up the file in to several message so each can be processed individually.
Finally once all these messages from splitter are processed, would like to invoke a listener or end point which will do some final checks/ updates to the whole integration job.
Please let me know how to achieve it
Thanks
Srinivas
You *can* accomplish this with a file inbound-channel-adapter followed by a splitter and ultimately an aggregator.
However, I think you might want to consider Spring Batch which handles this exact type of file-processing as a *Job*: spring-batch/
You can use the two together as well. What people are doing frequently is using Spring Integration to recognize the arrival of a File and then sending a Message to launch the Spring Batch job.
Not exactly needing a Aggregator. All that is need is something like a success count update after i complete my messages processed.
Spring batch - not sure if its needed for this one update. ?
Thanks Mark
Spring Batch is very lightweight and can be used for a single job like this... however, I think the question is whether you need to maintain any state about the Job execution. For example, do you want to know if certain records from the File have been skipped?
Are you not using any Aggregator at all?
In that case, is there any other way you are ensuring that all splitted messages are being processed?
An aggregator is what you need, I think. As soon as all messages are processed, in your custom aggregator you can update your success count / final checks.
The scenario is more like this
The file is expected to have lets say 10 records to bring back confirmations. After we process 10 records with success state, the whole process as success and update the status.
If we miss some records in the file or get failure state in those records, need to consider the process a failure.
So instead of going through all the messages and check status via Aggregator, A simple quot;listenerquot; can run a query and update the status accordingly.
Following?
Agree Batch would help achieve this but trying to see if there is a simple tweak i can do to my existing integration setup. Always execute this one last step once before integration ends.
Instead of introducing spring batch.
Thanks
Srinivas
@GPS : Right now we have chain with the Splitter and Service Activator. So all messages are expected to be passed on to the Service Activator . |
|