I need to send message to 3 services, and aggregate result at the end.
This is easy via publish-subscribe-channel->service-activator(s)->aggregator
.
The problem appears when one of the services is in reality 2 calls to other services. At this point I want to introduce additional publish-subscribe-channel
and aggregator.
Eg
publish-subscribe-channel1 -> service-activator group1 -> aggregator1
\/-> service call -> publish-subscribe-channel2 -> service-activator group2 -> aggregator2
As a result aggregator2
doesn't group message(send them out one by one).
Aggregator1
gets results from aggregator2
and send out message without waiting for messages from service-activator group 1.
Any suggestions?
All your publish-subscribe-channel
should have apply-sequence="true"
. Of course, if you don't use custom correlation
and release
strategies.
With apply-sequence="true"
the Framework populates standard correlation
MessageHeaders
and they are stored in the Stack
: the nested aggregator gets deal with correlation
of its scope and pop them from stack to be ready for the outer aggregation.
And the nested aggregator
should send its result to the input channel of outer aggregator
. For the last one it will look like just a result of a service.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.