wso2esb - how to cache response from endpoint in wso2 ESB -


i want cache response in proxy , when hit proxy again should me cached data. have tried using cache mediator unable find if data getting cached or not.so trying achieve if have data in cache shouldn't hit endpoint.it should send response cache. looking forward answer. in advance

i have service code as:

public class getmirrorvalue {     public string getvalue(string data) throws exception {     system.out.println("inside service code");         return data;     } } 

my insequence is:

<sequence xmlns="http://ws.apache.org/ns/synapse" name="checkcacheseq">    <cache scope="per-host" collector="false" hashgenerator="org.wso2.caching.digest.domhashgenerator" timeout="20">       <implementation type="memory" maxsize="100"/>    </cache>    <send>       <endpoint key="dummyep"/>    </send> </sequence> 

and out sequence is:

<outsequence xmlns="http://ws.apache.org/ns/synapse">    <cache scope="per-host" collector="true"/>    <send/> </outsequence> 

but whenever hit proxy service consecutively through try-it tool, data service not cache coz every time in server system.out.println("inside service code"); gets printed?

you can modify backend service (the endpoint invoked proxy service), print in server log, once request got hit. first request should hit backend. within cached period, requests won't go backend service. go backend service after cache expired. looking @ print on backend server log, can observe caching behavior.

http://docs.wso2.org/wiki/display/esb460/sample+420%3a+simple+cache+implemented+on+esb+for+the+actual+service


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -