1
votes

Using the splitter in Spring Integration, I split rows of data selected from a table in database. After Each message finish the process, I want to aggregate every message to one message like the old one. How can I do? I don't know how many the splitter splits message. All I know is just the correlation id in the header of the split message. Even if I aggregate the messages, I can not make the release strategy.

How can I solve this?

And Is there any way to insert multi-rows of data using jdbc-outbound-gateway or jdbc-outbound-channel-adaptor at one time without using splitter for inserting each one row?

1

1 Answers

2
votes

Actually, if you use the default splitter strategy, it will populate whole SequenceDetails including sequenceSize. In the end aggregator with default strategy can correlate message and release them using those SequenceDetails.

Of course, if you use the custom splitting logic you should provide those headers manually. If you know the size, of course - MessageBuilder#pushSequenceDetails for each splitted message.

In this part we need to know more info about you case. Some example of your code would be great too.

Re. batch insert: https://jira.spring.io/browse/INT-3364. As you see we haven't implemented it yet. But it enough simple to workaround it with direct JdbcTemplate usage from <outbound-channel-adapter>