spring integration - Aggregator that releases partial group based on correlation but holds on to rest of the messages -


I want to set up a correlation strategy on an aggregator so that it comes in the form of incoming file (in the form of message) To correlate the files that can be used so that all files related to the current date belong to the same group. Now that I have the value of several days of data, it is possible that I have collected 2 days of files. I want to base the release strategy on a file (message), which also includes the file name date, so there will be a bunch of files each day and will be done for the file to release files for that day from the aggregator But the files should be continued on the second day until the file is filed for that day.

So in this scenario, the correlation is clearly simple - but I am not sure how to release all, but only on the basis of correlation key are some specific messages of the group about the messaging In the documentary speaks, but it goes to the messaging store and I want to do all this in memory.

Let me expand with an example

I have a directory that is selected by file Inbound Channel Adapter

file -1-2014.04 .27.dat

file-2014-2014.04.27.dat

file -3-2014.04 .27.dat

  done-2014.04. 27.dat  

file-1-2014.04.28.dat

file- 2-2014.04.28.dat

  done Voting in these files as -2014.04.28.dat  

I have an aggregator in the flow where all the incoming files are being collected I was thinking that I can remove that date and put it in the correlation_id head so that the first 3 files will be related to one group and then the second 2 files will be related to the other group. Now I am using the work-2014.04 I am 27.dat file at that time I want to release the first 3 files so that the flow can be processed further but

file -1-2014.04.28.dat

hold the file -2-2014.04.28.dat

Unless I receive

done-2014.04.28.dat

and then release these 2 files Does.

Any help would be appreciated. Thank you

I'm not sure what you say when you say "correlation is simple" but Then you say that you only want to release part of the group. If they have different dates, then they will be in different groups, so there is no need to release the part of a group, except after midnight (or any time the next day), leaving the whole group Please give it. It is not absolutely clear why you need to have "done" message.

By default, the aggregator uses in-memory message archive ( SimpleMessageStore ).

Edit:

Just enter done file in the same group and find out your release strategy the presence of a done file . You can use an expression, but if the group can be large, then implement ReleaseStrategy and search for MessageGroup.getMessages () to Will be efficient. Done file.

The next step depends on the basis of the aggregator downstream. If you use the tornado to separate them in different files, you can simply add a filter to leave the done file if you deal directly with the collection of files, So completely ignore the file, or add a transformer to remove it from the archive.

In relation to the Reaper; Considering the files coming in real time, I was just suggesting that if you say, to run once a day (say at 01:00) to say it again, say 30 minutes, then Tomorrow

Edit:

See my comment on your "answer" below - You have < Code> filesLogger has 2 members .


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -