Contents
The Remove Cached Attribute filter allows you to delete
a message attribute value that has been stored in a cache. Each cache
is essentially a map of name-value pairs, where each value is keyed on a
particular message attribute. For example, it is possible to store a
cache of request messages according to their message ID. In this
case the message's id
attribute would be the key
into the cache, which would store the value of the request message's
content.body
message attribute.
In this example, the Remove Cached Attribute filter can
be used to remove a particular entry from the cache based on the
run-time value of a particular message attribute. By specifying the
id
message attribute to remove, the API Gateway will
look up the cache based on the value of the id
message attribute. When it finds a matching message ID in the cache, it
will remove the corresponding entry from the cache.
The example described above may be useful in cases where a request message may need to be cached and stored until the request has been fully processed and a response returned to the client. For example, if the request must be routed on to a back-end Web Service, but that Web Service is temporarily unavailable, it may be possible to configure the policy to re-send the cached request instead of forcing the client to retry.
For more information on how to configure a caching policy, see the topic on Global Caches.
Name:
Enter a name for this filter here.
Select Cache to Use:
Click the button on the right, and select the cache that contains the cached values that have been keyed according to the message attribute specified below. The list of currently configured caches is displayed in the tree. To add a cache, right-click the Caches tree node, and select Add Local Cache or Add Distributed Cache. Alternatively, you can configure caches under the Libraries node in the Policy Studio tree. For more details, see the topic on Global Caches.
Attribute Key:
Enter the message attribute that is used as the key into the cache in this field. At run-time, the API Gateway will populate the value of this message attribute, which will then be used to lookup the cache selected in the table above. If a match is found in the cache, the corresponding entry will be deleted from the cache.