@Override
    public long extract(final ConsumerRecord<Object, Object> record, final long partitionTime) {
        if (record.value() instanceof PageViewTypedDemo.PageView) {
            return ((PageViewTypedDemo.PageView) record.value()).timestamp;
        }

        if (record.value() instanceof PageViewTypedDemo.UserProfile) {
            return ((PageViewTypedDemo.UserProfile) record.value()).timestamp;
        }

        if (record.value() instanceof JsonNode) {
            return ((JsonNode) record.value()).get("timestamp").longValue();
        }

        throw new IllegalArgumentException("JsonTimestampExtractor cannot recognize the record value " + record.value());
    }
A timestamp extractor implementation that tries to extract event time from
the "timestamp" field in the Json formatted message.
streams/examples/src/main/java/org/apache/kafka/streams/examples/pageview/JsonTimestampExtractor.java