Sotona
Sotona

Reputation: 158

How to make inSequence without send

I have this WSO2 ESB proxy:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="sid008" transports="http" startOnLoad="true" trace="disable">
    <target>
        <inSequence>

            <switch source="get-property('inquiryId')">
                        <log level="full"/>
                <case regex="">

                        <send/>

                </case>
                 <default>

                 </default>
             </switch>

        </inSequence>

        <outSequence>                      
<....some processing..>
            <send/>

        </outSequence>
    </target>
    <publishWSDL key="CommonService.wsdl">
        <resource location="request.xsd" key="request.xsd"/>
        <resource location="response.xsd" key="response.xsd"/>
        <resource location="SMEV.xsd" key="SMEV.xsd"/>
        <resource location="statusAndError.xsd" key="statusAndError.xsd"/>
    </publishWSDL>
</proxy>

In this proxy in default case doesn't run outSequence without send mediator. How can I do it without send mediator

Upvotes: 1

Views: 1182

Answers (2)

Mike
Mike

Reputation: 36

Try this config for :

<default>
    <... some processing ...>
    <header action="remove" name="To"/>
    <property action="set" name="RESPONSE" scope="default" type="STRING" value="true"/>
    <send/>
</default>

With this config, you'll send response to client directly from inSequence part (you won't get into outSequence).

Upvotes: 2

Kasun Indrasiri
Kasun Indrasiri

Reputation: 983

The rational behind In and Out sequence is:

In seq : When a message comes to a proxy service from a client, it always goes to the In sequence.

Out Seq: When a proxy service sends a message out from ESB to a backend service, the response will always come to Out seq (Unless specify the sequence using receiving seq.)

Hope this helps.

Upvotes: 1

Related Questions