Clone mediator does not work for me (WSO2 API manager 2.1.0)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Clone mediator does not work for me (WSO2 API manager 2.1.0)

Richard Páleník
Hello team,

I need to process outgoing response from an API in an ERP application but leave the original message sent to the requestor without delay.

I am trying to put clone mediator in use, but it does not seem to work. Here is the setup:

<?xml version="1.0" encoding="UTF-8"?>

<sequence name="clone_it" trace="disable" xmlns="http://ws.apache.org/ns/synapse">

    <property expression="get-property('To')" name="xto" scope="default" type="STRING"/>

    <log description="" level="custom">

        <property expression="get-property('xto')" name="response"/>

    </log>

    <clone continueParent="true">

        <target>

            <sequence/>

            <endpoint>

                <http method="post" uri-template="http://10.0.0.32:9091/yd"/>

            </endpoint>

        </target>

    </clone>

</sequence>


The logging works, the original message goes through but no clone seems to be generated/sent (no error logged). I tried to use callout mediator instead and it works - but does not work for my purpose because it waits for a result and also it attaches the request context (path) to the endpoint path.

Can you help to unlock the problem with clone mediator? or suggest other alternative for this scenario? Many thanks.

Richard

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Clone mediator does not work for me (WSO2 API manager 2.1.0)

Shazni Nazeer
Hi Richard,

You can instead use a sequence like this,

<sequence name="clone_it" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
    <property expression="get-property('To')" name="xto" scope="default" type="STRING"/>
    <log description="" level="custom">
        <property expression="get-property('xto')" name="response"/>
    </log>
    <clone continueParent="true">
        <target>
            <sequence>
                <log description="" level="custom">
                    <property value="RESPONSE_CLONED" name="response_clone"/>
                </log>
                 <call>
                    <endpoint>
                       <http method="POST" uri-template="http://10.0.0.32:9091/yd"/>
                    </endpoint>
                 </call>
            </sequence>
        </target>
    </clone>
</sequence>

On Thu, Dec 14, 2017 at 2:16 AM, Richard Páleník <[hidden email]> wrote:
Hello team,

I need to process outgoing response from an API in an ERP application but leave the original message sent to the requestor without delay.

I am trying to put clone mediator in use, but it does not seem to work. Here is the setup:

<?xml version="1.0" encoding="UTF-8"?>

<sequence name="clone_it" trace="disable" xmlns="http://ws.apache.org/ns/synapse">

    <property expression="get-property('To')" name="xto" scope="default" type="STRING"/>

    <log description="" level="custom">

        <property expression="get-property('xto')" name="response"/>

    </log>

    <clone continueParent="true">

        <target>

            <sequence/>

            <endpoint>

                <http method="post" uri-template="http://10.0.0.32:9091/yd"/>

            </endpoint>

        </target>

    </clone>

</sequence>


The logging works, the original message goes through but no clone seems to be generated/sent (no error logged). I tried to use callout mediator instead and it works - but does not work for my purpose because it waits for a result and also it attaches the request context (path) to the endpoint path.

Can you help to unlock the problem with clone mediator? or suggest other alternative for this scenario? Many thanks.

Richard

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev