2 Replies Latest reply on Jun 28, 2011 12:17 AM by Michael Grom

    Return new Response from AggregationStrategy to original cxf caller

    Michael Grom Newbie

      Dear Forum,

       

      I'm trying to set up a "service facade" with Camel and CXF. After deployment to the Fuse ESB, a web service "X" is established accepting requests in a given format. The camel route then splits the request using multicast and funnles each message in a Transformer, and from there it is used as a request document for real web services. In the AggregatorStrategy, I try to retrieve the results from both calls to the real web service, create a response document and expect this document to be returned as the SOAPResponse by the original web service "X" to the caller.

      Well...that doesn't seem to work. Testing with soapUI shows me the response message of one of the real web service calls, not the message that I have composed in the AggregationStrategy.

       

      The route is configured using spring and split into several routes. Could it be that this is the source of the problem?

       

      ---

        <osgi:camelContext xmlns="http://camel.apache.org/schema/spring">

                <camel:route>

                  <camel:from uri="cxf:bean:crMaster?dataFormat=PAYLOAD"/>

                  <camel:to uri="log:input"/>

                  <camel:multicast>

                       <camel:to uri="seda:crMaster" />

                      <camel:to uri="seda:Apollo" />

                  </camel:multicast>

                </camel:route>

                <camel:route>

                     <camel:from uri="seda:crMaster" />

                     <camel:to uri="bean:crMessageBean" />

                     <camel:to uri="bean:cxfCRBean" />

                     <camel:to uri="seda:result" />

                </camel:route>               

                <camel:route>

                     <camel:from uri="seda:Apollo" />

                     <camel:to uri="bean:apolloMessageBean" />

                     <camel:to uri="bean:cxfApolloBean" />

                     <camel:to uri="seda:result" />

                </camel:route>               

                <camel:route>

                     <camel:from uri="seda:result" />

                     <camel:setHeader headerName="requestId">

                          <camel:constant>true</camel:constant>

                     </camel:setHeader>

                     <camel:aggregate strategyRef="aggregatorStrategy" completionTimeout="1000">

                          <camel:correlationExpression>

                               <camel:header>requestId</camel:header>

                          </camel:correlationExpression>

                          <camel:to uri="seda:aggregation" />

                  </camel:aggregate>

                     <camel:to uri="log:output" />

                </camel:route>

                <camel:route>

                     <camel:from uri="seda:aggregation" />

                     <camel:to uri="log:output" />

                </camel:route>

        </osgi:camelContext>

       

      ---

      Kind regards

      Michael