Hi all,

I'm trying to add caching functionality to my api service, so that repeated
requests would get a cached response. But instead of the saving the
response, the mediator is storing the message sent by the client and
returning this to repeating requests.
Here follows the configuration of my api.It describes a get resource that
receives two query parameters and uses them to create a payoad, which it
sends to a local dss service:


<api context="/config" name="myAPI" xmlns="http://ws.apache.org/ns/synapse";>
    <resource methods="GET">
        <inSequence>
        <cache collector="false"
hashGenerator="org.wso2.carbon.mediator.cache.digest.DOMHASHGenerator"
id="testCache" scope="per-mediator" timeout="200">
                <onCacheHit/>
                <implementation maxSize="100" type="memory"/>
            </cache>
            <property expression="$url:intg" name="uri.integration"
scope="default" type="STRING"/>
            <property expression="$url:inst" name="uri.institution"
scope="default" type="STRING"/>
            <payloadFactory media-type="xml">
                <format>
                    <con:show xmlns:con="http://com.dvg.wso2/configservice";>
                        <con:SEL_INTG_NAME>$1</con:SEL_INTG_NAME>
                        <con:SEL_INSTITUTION>$2</con:SEL_INSTITUTION>
                    </con:show>
                </format>
                <args>
                    <arg evaluator="xml"
expression="get-property('uri.integration')"/>
                    <arg evaluator="xml"
expression="get-property('uri.institution')"/>
                </args>
            </payloadFactory>
            <header name="Action" scope="default" value="urn:show"/>
            <send>
                <endpoint>
                    <address format="soap11"
uri="local:///services/INTG_DVG_ConfigService/"/>
                </endpoint>
            </send>
        </inSequence>
        <outSequence>
        <cache collector="true" scope="per-mediator" id="testCache"/>
            <send/>
        </outSequence>
        <faultSequence/>
    </resource>
</api>


Shouldn't the cache mediator, configured as it is, store the response of
the cache miss and return it in case of cache hit?
Why is it responding with the wrong content?


Regards,

Rodrigo Vasconcelos
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to