Deleted: See May21 11:23pm post for a better work-around.
Deleted: See May21 11:23pm post for a better work-around.
Last edited by Gary Russell; May 21st, 2011 at 10:29 PM. Reason: Remove kludgy workaround
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware
Yep, anyway tried the first suggestion with the same exception. Yet I didn't try extending the AbstractAggregatingMessageGroupProcessor.
For the other suggestion, I believe that the header-enricher will need access to the aggregator's MessageStore in order to do the correlation by itself and find the request message. My correlation/release beans are stateless so I can't see how they will help me, or I'm missing something?
Thanks for your help!
Last edited by Diego Bravo; May 21st, 2011 at 09:32 PM.
Here's a cleaner work-around; I just tested this and it works fine...
Code:public Message<String> aggregate(List<Message<String>> in) { return MessageBuilder.fromMessage(in.get(1)) .setHeader("requestReplyChannel", in.get(0).getHeaders().getReplyChannel()) .build(); }i.e. Copy the replyChannel to a temporary header; route the aggregator output to a header-enricher, and voila.Code:<int:aggregator input-channel="in" ref="agg" output-channel="route.reply"/> <int:header-enricher input-channel="route.reply"> <int:header name="replyChannel" expression="headers.requestReplyChannel"/> </int:header-enricher> <bean id="agg" class="org.myco.aggregator.gpr.GprAgg"/>
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware
it's working for me too... Awesome!
Thanks a lot for your help and patience Gary!
Glad to help.
I opened an improvement JIRA issue https://jira.springsource.org/browse/INT-1913, if you want to watch it.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware
BTW, this works too..
Code:public Message<String> aggregate(List<Message<String>> in) { return MessageBuilder.fromMessage(in.get(1)) .setReplyChannel((MessageChannel) in.get(0).getHeaders().getReplyChannel()) .build(); }But it's perhaps not as obvious as to why it works :-)Code:<int:aggregator input-channel="in" ref="agg" output-channel="route.reply"/> <int:service-activator input-channel="route.reply" expression="payload"/>
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware