Spring Integration. Who exactly is the “iteration” of split messages from the splitter?

I have few basic questions regarding an element splitterin SI.

I understand that in order to form individual splitter logic, we need to expand AbstractMessageSplitterand redefine the method splitMessage.

This collection of split messages is then presented to output-channelfrom splitter(if no response channel has been configured for the incoming message).

output-channelof splittermay be input-channelfor another si component. Assume the component is simple service-activator.

The manual says that the message " each " of the collection will be processed by the downstream configuration to which this collection was presented. Therefore, in our example, it service-activatorwill process the message each .

1) My request " who " exactly repeats the assembly and presents the message " each " from the collection on the service activator input channel?

2) Suppose that there are all direct channels. Now, if output-channelof service-activator is configured as nullChannel, will the message “ next ” from the collection still be displayed after the successful completion of the first message?

3) , aggregator. , . , " " output-channel? , ? ?

, , .

, .

+4
1

. !

1) AbstractMessageProducingHandler:

protected void sendOutputs(Object result, Message<?> requestMessage) {
    if (result instanceof Iterable<?> && shouldSplitOutput((Iterable<?>) result)) {
        for (Object o : (Iterable<?>) result) {
            this.produceOutput(o, requestMessage);
        }
    }
    else if (result != null) {
        this.produceOutput(result, requestMessage);
    }
}

output-channel.

2) , DirectChannel, . , raw java:

 for (Object o : collection) {

 }

: sync, , . - Exception. , Java: -).

3) . raw Java :

split(Collection<?>, Future<?>);  
 --->>
 for (Object o : collection) {
     process(Object, Future<?>)
 }

splitter EIP. push. , replyChannel.

, , Future<?> - replyChannel. , , . . TemporaryReplyChannel.

, async, . ExecutorChannel output-channel <splitter> , . , , . , <aggregator>.

, -.

0

Source: https://habr.com/ru/post/1612515/


All Articles