Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7446

Better error message to explain the upper limit of TimeWindow

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 2.0.0
    • 2.2.0
    • streams

    Description

      The following code throws a IllegalArgumentException.

      import org.apache.kafka.streams.kstream.TimeWindows
      import scala.concurrent.duration._
      val timeWindow = TimeWindows
      .of(1.minute.toMillis)
      .advanceBy(2.minutes.toMillis)
      

      The exception is as follows and it's not clear why 60000 is the upper limit (not to mention that AdvanceMs with the uppercase A did also confuse me).

      java.lang.IllegalArgumentException: AdvanceMs must lie within interval (0, 60000].
      at org.apache.kafka.streams.kstream.TimeWindows.advanceBy(TimeWindows.java:100)
      ... 44 elided

      I think that the message should be more developer-friendly and explain the boundaries, perhaps with an example (and a link to docs)?

      Attachments

        Issue Links

          Activity

            People

              mrsrinivas Srinivas Reddy
              jlaskowski Jacek Laskowski
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: