简体   繁体   中英

WSO2 Enterprise Integrator 6.3.0 cache mediator

i'm using the cache mediator for store a big response from the backend to have less time in subsequent calls. I have added, before the call, the cache mediator with this configuration:

<cache collector="false" maxMessageSize="100000" timeout="20">
    <protocol type="HTTP">
        <methods>*</methods>
        <headersToExcludeInHash/>
        <responseCodes>2[0-9][0-9]</responseCodes>
        <enableCacheControl>false</enableCacheControl>
        <includeAgeHeader>false</includeAgeHeader>
        <hashGenerator>org.wso2.carbon.mediator.cache.digest.HttpRequestHashGenerator</hashGenerator>
    </protocol>
    <implementation maxSize="100000"/>
</cache>

and before the respond i have added this

<cache collector="true"/>

i have done this following the documentation here Cache Mediator

If i call the api without the second cache mediator, it answer me but not cache and if i call the api with both the cache mediator it turns in error:

"Request messages cannot be handled in a collector cache"

What i wrong? Thank you

This error comes up when, a cache mediator with collector true is defined in the request flow. (ie The cache collector is used before calling a backend server from the ESB). Please make sure the flow is correct.

Please share the synapse configuration if the issue is not resolved, so that we can help.

I have tried to insert the mediator with colllector true in the response flow but no changes. This is my synapse config

突触配置

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM