Hello Adrian,

When you call "put()" on the windowed state store that does not specify a
timestamp, then the `timestamp()` is retrieved to use as the default
timestamp.

----------------------

public synchronized void put(final K key, final V value) {
    put(key, value, context.timestamp());
}

----------------------

The question is when were you calling `put()` in the Transformer, did
you ever call it in `init()` function?


Guozhang


On Wed, Jun 14, 2017 at 11:08 AM, Adrian McCague <adrian.mcca...@zopa.com>
wrote:

> Hi All
>
> We have a transformer implementation in our Kafka Streams application that
> raises this exception, sometimes, when starting.
>
> "java.lang.IllegalStateException: This should not happen as timestamp()
> should only be called while a record is processed"
>
> This happens when 'put' is called on a state store within the `transform`
> method of a custom `Transformer`.
>
> The full trace can be seen here, apologies for the JSON formatting:
> https://pastebin.com/QYKE7bSH
>
>
>   *   We did not see this when the input and output topic of the topology
> had only a single partition.
>   *   We do not see this when the streams thread is handling only a single
> partition of data. (ie 4 partitions, 4 consumers in the consumer group)
>   *   We see this when deploying the consumer group and the first
> consumers to connect are handling multiple partitions (assumed).
> Once all have started and each consumer is processing a single partition
> each, the issue appears to go away.
>
> We are using Kafka Streams Client: 0.10.2.1
>
> Any suggestions would be welcome as for now I am assuming a programming
> error.
> I can confirm that within our code, we never call `timestamp()` on the
> context.
>
> Thanks
> Adrian
>



-- 
-- Guozhang

Reply via email to