Cache Problem - Lookup Cache only available on the message processor Populate Cache was executed on.

Not applicable

There is a problem with the caching not being available when a different message processor is being used then the one that was used when the object was added to the cache.

For ex :

1. Adding an object to the cache with a post call.

-----> This will then generate a uuid in javascript and "transactionId" and add the json body as an object in the cache under that uuid.

2. Sending the generated id in a GET call to retrieve the object back from the cache

-------> Result was cache hit = false

3. Sending the generated id in a second GET call to retrieve the object back from the cache

---------> Result was cache hit = true

0 1 212
1 REPLY 1

Not applicable

Javascript :-

var drivewiseOrder = JSON.parse(context.getVariable("request.content"));

drivewiseOrder.transactionId = guid();

context.setVariable("drivewiseOrder", drivewiseOrder);

context.setVariable("transactionId", drivewiseOrder.transactionId);

While populating the cache, javascript object has been cached. When we changed the object cached to string, cachehit issue has been gone.

In populate cache policy, flow variable "drivewiseOrder" with javascript object "drivewiseOrder" has been cached. change the drivewiseOrder" to JSON.stringify(drivewiseOrder) in javascript.

Modified javascript :-

var drivewiseOrder = JSON.parse(context.getVariable("request.content"));

drivewiseOrder.transactionId = guid();

context.setVariable("drivewiseOrder", JSON.stringify(drivewiseOrder));

context.setVariable("transactionId", drivewiseOrder.transactionId);