/** * Declares that the source will assign the time of ingestion as the event * timestamp. It will call {@code System.currentTimeMillis()} at the moment * it observes an event from the data source and assign it as the event * timestamp. * <p> * <strong>Note:</strong> when snapshotting is enabled to achieve fault * tolerance, after a restart Jet replays all the events that were already * processed since the last snapshot. These events will then get different * timestamps. If you want your job to be fault-tolerant, the events in the * stream must have a stable timestamp associated with them. The source may * natively provide such timestamps (the {@link #withNativeTimestamps(long)} * option). If that is not appropriate, the events should carry their own * timestamp as a part of their data and you can use {@link * #withTimestamps(DistributedToLongFunction, long) * withTimestamps(timestampFn, allowedLag} to extract it. * <p> * <strong>Note 2:</strong> if the system time goes back (such as when * adjusting it), newer events will get older timestamps and might be * dropped as late, because the allowed lag is 0. */ default StreamStage<T> withIngestionTimestamps() { return withTimestamps(o -> System.currentTimeMillis(), 0); }