Package org.apache.beam.sdk.io.kafka
Interface KafkaPublishTimestampFunction<T>
- All Superinterfaces:
Serializable
An interface for providing custom timestamp for elements written to Kafka.
-
Method Summary
Modifier and TypeMethodDescriptiongetTimestamp(T element, Instant elementTimestamp) Returns timestamp for element being published to Kafka.static <T> KafkaPublishTimestampFunction<T> ReturnsKafkaPublishTimestampFunctionreturns element timestamp from ProcessContext.
-
Method Details
-
getTimestamp
Returns timestamp for element being published to Kafka. See @ProducerRecord.- Parameters:
element- The element being published.elementTimestamp- Timestamp of the element from the context (i.e. @DoFn.ProcessContext.timestamp()
-
withElementTimestamp
ReturnsKafkaPublishTimestampFunctionreturns element timestamp from ProcessContext.
-