[ https://issues.apache.org/jira/browse/NIFI-4987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16482913#comment-16482913 ]
ASF GitHub Bot commented on NIFI-4987: -------------------------------------- Github user bbende commented on the issue: https://github.com/apache/nifi/pull/2726 Was looking into this a little more and I believe we can keep all of the origin getAndPutIfAbsent, and just add the following right after the set: `redisConnection.expire(kv.getKey(), 1000);` Replacing 1000 with whatever time variable. > Support TTL in Redis > -------------------- > > Key: NIFI-4987 > URL: https://issues.apache.org/jira/browse/NIFI-4987 > Project: Apache NiFi > Issue Type: Improvement > Reporter: Brian Ghigiarelli > Assignee: Sivaprasanna Sethuraman > Priority: Minor > > To properly integrate the NiFi with Redis, it would be nice to support > setting TTLs for keys, whether a global TTL is used for the particular Redis > database, or a configurable TTL is used for each key. At the moment, the > PutDistributedMapCache processor that uses the > RedisDistributedMapCacheClientService and calls to the > RedisConnectionPoolService does not pass in any TTL / EXPIRE parameter, so > Redis will cache the value potentially forever unless Redis itself clears the > key based on its configured maxmemory eviction strategy. > On > [SO|https://stackoverflow.com/questions/49321005/setting-ttl-on-redis-with-apache-nifi-putdistributedmapcache/49324205#49324205], > [~bbende] suggested either a PutRedis processor or a modification to the > RedisDistributedMapCacheClientService. -- This message was sent by Atlassian JIRA (v7.6.3#76005)