Hello,
I'm looking for an expert advice please.
I need to build an API call that does this:
I would greatly appreciate some simple code please as well as general advice on the best approach.
Lots of thanks in advance,
Anton.
Solved! Go to Solution.
HI @Anton+Bar
Please find the attached zip. See if that works.
Assumptions I made to build the proxy: I am pointing it to httpbin.org/get end point. I wrote another mock service that generated a Guid when the data is not available in Cache.
Created an Env cache called "demoCache"
Hope this gives you some idea
HI @Anton+Bar
Please find the attached zip. See if that works.
Assumptions I made to build the proxy: I am pointing it to httpbin.org/get end point. I wrote another mock service that generated a Guid when the data is not available in Cache.
Created an Env cache called "demoCache"
Hope this gives you some idea
Thank you Sai! Quick question - is the caching persistent or will it "forget" the entries after some time? I was researching after I posted this and bumped into KeyValueMap but couldn't make it work so far.
Yes, its time based and transient. Thats why I recommend that. KVM is not for that purpose. For more info on Caching, check this doc
@Anton+Bar - please accept this answer if it resolved your issue
I will accept when it will. Sorry, still not with you. I'm looking for persistent data storage, not something like cache.
Sure. My question to you is - you have a source of truth anyways, the callout which provides that info, then why does this need to be persisted always ? We can always go back to the backend system which I guess is the source of truth.
Yes, that's true, but to get that data string might take a relatively long time (long story as to why it is so), so the first call can take around 30 seconds. I'd like to avoid that.
Ok. You can have a longer Cache TTL in that case ? What if the values in the source change, how will that update KVM ? In other words, you will need to sync both the data sources. In stead have one as primary and the other a temp data store. Again this is my 2 cents.
Good point! However in our case the values in the source do not change, so I'd be happier with KVM. Would that work?
Yes it can. How many records do you think will be stored ? The reason I tell this is its generally recommended to store config in there. However its a persistent store.
I see, so we'll probably use Cache then.
Awesome !!!