Store the data into cache and retrive data from cache

Not applicable

Hello,

I have created a cache in environment configurations. I have create no target proxy for this.By using populate cache policy I have store some data to the cache. I have lookupcache policy for retreiving the data from cache. I am getting 200 OK response but how can I know that whether the data is stroed in cache or not.

4236-populate.jpg

this what I have given for sample in populate cache policy.

4237-lookup.jpg

This is lookup cache policy.


Could please guide me.

Thank you.

0 4 1,232
4 REPLIES 4

Not applicable

@NAVAJEEVANA BATHULA: see the trace.. if it is coming from cache then will not call the backend.

The lookup policy will add flow variables after it is executed - see this page in the documentation for a list of all variables associated with this type of policy.

  • You can check the value of lookupcache.{policy-name}.cachehit to understand if the cache lookup returned a result.
  • If the cache population policy fails, a runtime fault will be thrown with details about the failure. Fault variables also capture the error and are available to use for conditions/error handling.

Does the <Source> variable you've specified (flowVar) exist with a value? If not, you won't be caching anything. It's worth noting that the lookup policy is configured to set the value it finds in cache to the variable specified in <AssignTo> (in your case, f1).

The <CacheKey> you are constructing in the two policies must be consistent, otherwise you will never experience a cache hit.

Not applicable

Hi NAVAJEEVANA,

Are you getting data in "f1" flow variable or not. If not then it is not stored or your lookup is not configured properly.

Populate cache is for populating data in cache at run time and lookup is for retrieving data at run time. Ideally these two has to be used in different flows/operations. If you did it intentionally for testing purpose then fine.

If "f1" flow variable is not having any data then i see an issue while doing lookup that you are not passing one key fragment value "Cache".

For debug purpose you can do trace on and hit this API from postman for soapui. Better you set the "f1" variable data in your response to verify it.

Thank you @Dinesh Kumar for your response. I am not getting data in "f1" flow variable and working on it.