You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by wheli <mi...@medfx.com> on 2015/11/17 16:25:49 UTC

Spring-ws response when using split/aggregate

Hello,

I have a Java DSL route that takes a spring-ws request and sends a response. 

from("spring-ws:rootqname:{urn:foo}barRequest?endpointMapping=#endpointMapping")
                        .beanRef(BeanRef.UTILS, "blah")
                        .beanRef("xdsLogic", "processResponse")
                        .marshal(jaxbRs);

This works fine. I am now attempting to grab all the attachments from the
request, split them, process them simultaneously, aggregate the results and
then send a response. Functionally, it works, but i am no longer getting the
response back.

from("spring-ws:rootqname:{urn:foo}barRequest?endpointMapping=#endpointMapping")
                        .split().method(BeanRef.SOAP_ATTACHMENT_SPLITTER,
"splitMessageOnAttachments")
                        .beanRef(BeanRef.UTILS, "blah")
                        .aggregate(constant(true), new
SoapAttachmentAggregationStrategy())
                        .completionSize(simple("${in.header[" +
HeaderKeys.SOAP_ATTACHMENT_COUNT + "]}"))
                        .beanRef("xdsLogic", "processResponse")
                        .marshal(jaxbRs);

If i comment out the split, aggregate, and completionSize lines, the
response works again. So the splitting and aggregating is definitely
screwing something up, but I can't figure out what it is exactly.  I tried
adding "exchange.setPattern(ExchangePattern.InOut);" to the end of
"processResponse", but that doesn't seem to make any difference. 

Any ideas?







--
View this message in context: http://camel.465427.n5.nabble.com/Spring-ws-response-when-using-split-aggregate-tp5773994.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Spring-ws response when using split/aggregate

Posted by "calyan.bandi" <ca...@gmail.com>.
Hi,

You may need to provide the reply aggregation strategy in the split() method
itself. It should be something like below. Also i doubt that the MEP needs
to be set before splitting.

              split(new MyExpression(), new
SoapAttachmentAggregationStrategy());

I recently worked on a similar thing, and we were sending data via direct
component. We got the aggregated response back to the caller. I had used
scatter-gatherer EIP for this to work.

Thanks,
Kalyan



--
View this message in context: http://camel.465427.n5.nabble.com/Spring-ws-response-when-using-split-aggregate-tp5773994p5774103.html
Sent from the Camel - Users mailing list archive at Nabble.com.