Search code examples
design-patternswso2esbwso2-esb

WSO2 ESB Mediation flow


I was trying to implement a simple message flow with WSO2 ESB, but not very familiar with this topic:

"a consumer Client communicate with a service provider to get back a random integer number." Ideally i would like to send the random number back to the Client but also to another service.

  • I have first defined a Custom proxy (http, https protocols);
  • a InSequence: LOG mediator, Send Mediator;
  • an EndPoint of the Actual Service called "RandomNumbers" (http://localhost:8280/services/RandomNumbers)
  • an OutSequence: LOG mediator, SEND mediator
  • fault sequence: existing fault

Can someone check if this implementation is correct? many thanks

<proxy name="ClientAskNumber" transports="https http" startOnLoad="true" trace="disable">
        <target faultSequence="fault">
            <endpoint>
                <address uri="http://localhost:8280/services/RandomNumbers"/>
            </endpoint>
            <inSequence>
                <log/>
                <send/>
            </inSequence>
            <outSequence>
                <log/>
                <send/>
            </outSequence>
        </target>
    </proxy>

Solution

  • Corrected the configuartion..

     <proxy name="ClientAskNumber" transports="https http" startOnLoad="true"
            trace="disable">
            <target faultSequence="fault">
                <inSequence>
                    <log level="full">
                        <property name="Insequence" value="***" />
                    </log>
                    <send>
                        <endpoint>
                            <address uri="http://localhost:8280/services/RandomNumbers" />
                        </endpoint>
                    </send>
                </inSequence>
                <outSequence>
                    <log level="full">
                        <property name="Outsequence" value="***" />
                    </log>
                    <send />
                </outSequence>
            </target>
        </proxy>