property to be used for skipping the KeyValueMaps policy if the Kvm cache is not expired

I have created a KVM policy with below specifications-

 

<KeyValueMapOperations name="KVM-1"  mapIdentifier="TestKvm">
  <ExclusiveCache>false</ExclusiveCache>
  <ExpiryTimeInSecs>86400</ExpiryTimeInSecs>
  <Get assignTo="loggingLevels">
    <Key>
      <Parameter>LoggingLevels</Parameter>
    </Key>
    <Scope>environment</Scope>
  </Get>
</KeyValueMapOperations>

 

As per the configuration I have kept expiry time as 1 day. Now in my proxy i want this KVM to be executed only when the cached kvm value has expired . (similar to the way we use caching with the help of Populate & lookup cache).

I am looking for some property that i can use it as a condition for the kvm to be executed.

Solved Solved
0 1 117
1 ACCEPTED SOLUTION

I understand your question, and.... the policy takes care of that for you.

The KVM Get operation behaves this way:

  • check the cache for the entry associated with the specified key.
    • if a cached entry is not available, then read the entry from persistent store, and load the value into the cache, with the specified key, and with the specified expiry time
    • if a cached entry is available, then use it.
  • copy the cached entry into the specified context variable

The "copy from cache to context variable" is very fast. It will take much less time than 1ms. So there is no need to "conditionally" execute a KVM policy based on the expiry of the value you want to retrieve.

in my proxy i want this KVM to be executed only when the cached kvm value has expired .

It is unnecessary for you to configure your proxy this way.

View solution in original post

1 REPLY 1

I understand your question, and.... the policy takes care of that for you.

The KVM Get operation behaves this way:

  • check the cache for the entry associated with the specified key.
    • if a cached entry is not available, then read the entry from persistent store, and load the value into the cache, with the specified key, and with the specified expiry time
    • if a cached entry is available, then use it.
  • copy the cached entry into the specified context variable

The "copy from cache to context variable" is very fast. It will take much less time than 1ms. So there is no need to "conditionally" execute a KVM policy based on the expiry of the value you want to retrieve.

in my proxy i want this KVM to be executed only when the cached kvm value has expired .

It is unnecessary for you to configure your proxy this way.