Pushkar
Pushkar

Reputation: 7590

Custom aggregation in Mule ESB

I have the following use case in Mule ESB -

  1. Expose a SOAP endpoint
  2. Depending on a attribute in the SOAP request do conditional routing
    a. If the parameter value is 'a' then get response from one outbound webservice
    b. If parameter value is 'b' then get responses from multiple outbound services and aggregate them using a custom aggregation.

How do i go about doing this using Mule ESB?

Upvotes: 2

Views: 1371

Answers (2)

well I suggest to take a look about scatter gather component, it would be nice for what you need.

you could read about this in the folowing link: https://docs.mulesoft.com/mule-user-guide/v/3.6/scatter-gather

The main idea is to do something like this:

<scatter-gather doc:name="Scatter-Gather">
        <processor-chain>
            <flow-ref name="getUnitedFlightsFlow" doc:name="getUnitedFlightsFlow"/>
            <filter ref="FilterNotArrayList" doc:name="Filter not an ArrayList"/>
        </processor-chain>
        <processor-chain>
            <flow-ref name="getDeltaFlightsFlow" doc:name="getDeltaFlightsFlow"/>
            <filter ref="FilterNotArrayList" doc:name="Filter not an ArrayList"/>
        </processor-chain>
        <processor-chain>
            <flow-ref name="getAmericanFlightsFlow" doc:name="getAmericanFlightsFlow"/>
            <filter ref="FilterNotArrayList" doc:name="Filter not an ArrayList"/>
        </processor-chain>
    </scatter-gather>

in this example I use the component to take a choice and call a subflow to execute one particular dutty for one of each.

I hope this help you.

Upvotes: 0

Related Questions