cache
Stores each message in a cache.
- Common
- Advanced
# Common config fields, showing default valuesoutput:label: ""cache:target: ""key: ${!count("items")}-${!timestamp_unix_nano()}max_in_flight: 1
# All config fields, showing default valuesoutput:label: ""cache:target: ""key: ${!count("items")}-${!timestamp_unix_nano()}ttl: ""max_in_flight: 1
Caches are configured as resources, where there's a wide variety to choose from.
The target field must reference a configured cache resource label like follows:
output:cache:target: fookey: ${!json("document.id")}cache_resources:- label: foomemcached:addresses:- localhost:11211default_ttl: 60s
In order to create a unique key value per item you should use function interpolations described here.
Performance​
This output benefits from sending multiple messages in flight in parallel for
improved performance. You can tune the max number of in flight messages with the
field max_in_flight.
Fields​
target​
The target cache to store messages in.
Type: string
Default: ""
key​
The key to store messages by, function interpolation should be used in order to derive a unique key for each message. This field supports interpolation functions.
Type: string
Default: "${!count(\"items\")}-${!timestamp_unix_nano()}"
# Exampleskey: ${!count("items")}-${!timestamp_unix_nano()}key: ${!json("doc.id")}key: ${!meta("kafka_key")}
ttl​
The TTL of each individual item as a duration string. After this period an item will be eligible for removal during the next compaction. Not all caches support per-key TTLs, and those that do not will fall back to their generally configured TTL setting. This field supports interpolation functions.
Type: string
Default: ""
Requires version 3.33.0 or newer
# Examplesttl: 60sttl: 5mttl: 36h
max_in_flight​
The maximum number of messages to have in flight at a given time. Increase this to improve throughput.
Type: int
Default: 1