You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i followed the discussion in the forum and i think the iterator would be very convenient but i guess will not work with the AbstractMessageSplitter. Andrew intends to lazy load the rows but behind the iterator any impl has to do the same as building a List<String> or List<MessageBuilder> to determining the full sequenceSize. A Future<Integer> would be nice but it is currently hard bounded to Integer in the MessageBuilder and other places.... any ideas?
Alex, I think you are right. But since SEQUENCE_SIZE is put for AbstractMessageAggregator and CompletionStrategy the need to be redesigned to support iterators. Currently they rely on the idea that the message list will be hold in memory. So there will be no real advantage if Future<Integer> is used for cases when the number of messages is huge.
Or they can be left intact for the usual cases when splitter produces a small number of messages, and if user uses an iterator to split message to large number of messages, he will either implement his own AbstractMessageBarrierHandler or not aggregate messages at all. So I propose to put SEQUENCE_SIZE when a splitter returns a List and to omit this header when the returned value is an Iterator.
As a side note, AbstractMessageBarrierHandler .sendReplies should accept Iterable<Message> instead of Collection<Message>, because it only iterates on them.
Andrew, good points. the sequenceSize can be embedded in the last message of a group so that any custom aggregator may use it. i prototyped a streaming splitter and will submit a patch.
Good points. I agree and I'll go further. Aggregation of all the split messages will make less sense if you need an Iterator (presumably because holding the full collection in memory is too expensive).
It could be that the split messages will be filtered (reduced in size) before aggregation but still requiring a custom CompletionStrategy for this sounds perfectly reasonable to me.
Activity
spring-operator commentedon May 18, 2009
Iwein Fuld commented
Both Iterator and Iterable should be supported. This gives the most flexibility.
spring-operator commentedon May 19, 2009
Alex Peters commented
i followed the discussion in the forum and i think the iterator would be very convenient but i guess will not work with the AbstractMessageSplitter. Andrew intends to lazy load the rows but behind the iterator any impl has to do the same as building a List<String> or List<MessageBuilder> to determining the full sequenceSize. A Future<Integer> would be nice but it is currently hard bounded to Integer in the MessageBuilder and other places.... any ideas?
spring-operator commentedon May 19, 2009
Andrew Skiba commented
Alex, I think you are right. But since SEQUENCE_SIZE is put for AbstractMessageAggregator and CompletionStrategy the need to be redesigned to support iterators. Currently they rely on the idea that the message list will be hold in memory. So there will be no real advantage if Future<Integer> is used for cases when the number of messages is huge.
Or they can be left intact for the usual cases when splitter produces a small number of messages, and if user uses an iterator to split message to large number of messages, he will either implement his own AbstractMessageBarrierHandler or not aggregate messages at all. So I propose to put SEQUENCE_SIZE when a splitter returns a List and to omit this header when the returned value is an Iterator.
As a side note, AbstractMessageBarrierHandler .sendReplies should accept Iterable<Message> instead of Collection<Message>, because it only iterates on them.
Lots of changes :-(
spring-operator commentedon May 20, 2009
Alex Peters commented
Andrew, good points. the sequenceSize can be embedded in the last message of a group so that any custom aggregator may use it. i prototyped a streaming splitter and will submit a patch.
spring-operator commentedon May 21, 2009
Alex Peters commented
just uploaded a patch with an AbstractStreamingMessageSplitter class for Iterator+ support. this could replace the AbstractMessageSplitter class.
added minor refactoring and a litte fix in AbstractMessageHandlerFactoryBean
spring-operator commentedon May 21, 2009
Alex Peters commented
I'm going to fix NPE scenarios in Resequencer and SequenceSizeCompletionStrategy
spring-operator commentedon May 27, 2009
Iwein Fuld commented
Good points. I agree and I'll go further. Aggregation of all the split messages will make less sense if you need an Iterator (presumably because holding the full collection in memory is too expensive).
It could be that the split messages will be filtered (reduced in size) before aggregation but still requiring a custom CompletionStrategy for this sounds perfectly reasonable to me.
spring-operator commentedon Jul 18, 2014
Gary Russell commented
Merged and backported.