key value map

gopaldurgoji
Participant III

Im storing a header value in key value map but using the put operation in key value map policy.

The value is getting stored successfully.

But when I try to retrieve the above stored value by using another KVM policy using get operation im not able to retrive the value or assign it to another variable?

Solved Solved
0 2 229
1 ACCEPTED SOLUTION

robert
Participant V

Hi @Gopal D J,

What you described is likely the result of the KVM caching mechanism or how long it takes for the KVM to reflect the changes back. It all depends on how quick the "Get" is called after the "Put." Therefore, instead of KVM, a better approach might be to use the actual caching policies (populate cache and lookup cache). KVM is meant for more longer-term config/static type storage. What you seem to be after is dynamic data storage and retrieval so caching might be a better solution.

One note: if you are only using the data within the same request, and don't need it for other requests, then just store the header value in a variable and the next policy can grab it from there.

Hope this helps! If so, please click accept.

View solution in original post

2 REPLIES 2

robert
Participant V

Hi @Gopal D J,

What you described is likely the result of the KVM caching mechanism or how long it takes for the KVM to reflect the changes back. It all depends on how quick the "Get" is called after the "Put." Therefore, instead of KVM, a better approach might be to use the actual caching policies (populate cache and lookup cache). KVM is meant for more longer-term config/static type storage. What you seem to be after is dynamic data storage and retrieval so caching might be a better solution.

One note: if you are only using the data within the same request, and don't need it for other requests, then just store the header value in a variable and the next policy can grab it from there.

Hope this helps! If so, please click accept.

@Robert Johnson Thanks for the information and you are correct , Im after the dynamic data .

Once the key value map is stored, Im trying to access the same in the next call.