1

I try to query my local window state stores like this:

long timeFrom = 0;
long timeTo = System.currentTimeMillis();
WindowStoreIterator<Long> iterator = windowStore.fetch("topic name", timeFrom, timeTo);

I only get around about 36 hours of windowed data back, but would like to get far back in the past.

I tried to configure the retention in several ways, and also restarted my kafka server and zookeeper:

in config/server.properties: log.retention.hours=87600

bin/kafka-topics.sh --zookeeper zk.yoursite.com --alter --topic topicName --config retention.ms=86400000

Still Kafka does not keep old data.

micgn
  • 245
  • 1
  • 4
  • 14

2 Answers2

1

I think you are looking for window retention, not log retention. If so, you can find out how to configure this to your liking here http://docs.confluent.io/current/streams/developer-guide.html#windowing

dawsaw
  • 2,283
  • 13
  • 10
  • funny thing, when defining this window retention, data from the past appear immediately - so they have never been deleted, but just not been fetched – micgn Sep 05 '17 at 19:23
  • yeah it's the window retention, so the data still exists in the change log to pull up, but you have to tell it to go get it :) – dawsaw Sep 05 '17 at 20:59
0

check this setting log.retention.bytes to see if you're deleting data after a certain size. Retention policy can also be size based.

moon
  • 1,702
  • 3
  • 19
  • 35