Cache Read
The Cache Read node reads key/value pairs from the global cache, or from the flow variables. Optionally, it can delete keys and read from the cache.
The Cache Read node consists of one input terminal (Input) where the key values are passed in, and two output terminals (Matched and Unmatched).
The matched keys are written to the Matched terminal. Unmatched keys are written to the Unmatched terminal.
Data is sent to the Input terminal as a set of keys or a single key and each key is looked up and returned in the response. If the Key Prefix property is set, it is prepended to each key value to provide name-spacing. The input can optionally contain values, but they will be ignored.
Example 1: If the Data Format is delimited, and the delimiters are set to defaults, the data can either be sent as shown here:
Key1\n
Key2\n
or:
Key1,valA,ValB\n
Key1,valA,ValB\n
In the later case, everything between the first comma and the newline (value) is ignored.
Example 2: If the Data Format is JSON array:
[
{
"key": "Key1",
"value": "Value1"
},
{
"key": "Key2"
}
]
The Key1 value set to Value1 is ignored.
Example 3: If the Data Format is None, the node could then be used as a source node, with no data passed to input terminal. A new property “Key1” is enabled to specify the name of the key.
Example 4: If the Key Pattern is specified, the node could then be used as a source node, with no data passed to input terminal. If the scope is Flow Variable, the pattern is a regular expression pattern (regex) and all keys that match the regex are retrieved. If the scope is Cache, the pattern is a glob style pattern and all keys that match the glob are retrieved.
Example regular expression:
a.b matches a1b or acb.
a*.b matches acdefb
Example glob pattern:
a?b matches a1b or acb.
a*b matches acdefb