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> ReturnsKafkaPublishTimestampFunction
returns 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
ReturnsKafkaPublishTimestampFunction
returns element timestamp from ProcessContext.
-