You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<1> Set to `true` if the JSON record structure has an attached schema
268
268
269
+
[[_sink_ttl]]
270
+
== TTL (Time To Live)
271
+
272
+
The {name} supports setting TTL (Time To Live) for Redis keys to automatically expire data after a specified duration. TTL can be configured globally for all keys or per-message using Kafka headers.
273
+
274
+
=== Global TTL Configuration
275
+
276
+
Set a global TTL for all keys using the `redis.key.ttl` configuration property:
277
+
278
+
[source,properties]
279
+
----
280
+
redis.key.ttl = 3600 # TTL in seconds (1 hour)
281
+
----
282
+
283
+
=== Per-Message TTL
284
+
285
+
Include a `redis.key.ttl` header in your Kafka messages to set TTL for individual records:
286
+
287
+
[source,java]
288
+
----
289
+
ProducerRecord<String, String> record = new ProducerRecord<>("topic", "key", "value");
0 commit comments