[
https://issues.apache.org/jira/browse/FLINK-8500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16466047#comment-16466047
]
ASF GitHub Bot commented on FLINK-8500:
---------------------------------------
Github user FredTing commented on a diff in the pull request:
https://github.com/apache/flink/pull/5958#discussion_r186462871
--- Diff:
flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/Kafka010Fetcher.java
---
@@ -78,6 +79,69 @@ public Kafka010Fetcher(
useMetrics);
}
+ private class KafkaConsumerRecordWrapper10 implements
ConsumerRecordMetaInfo {
+ private static final long serialVersionUID =
2651665280744549935L;
+
+ private final ConsumerRecord<byte[], byte[]> consumerRecord;
+
+ public KafkaConsumerRecordWrapper10(ConsumerRecord<byte[],
byte[]> consumerRecord) {
+ this.consumerRecord = consumerRecord;
+ }
+
+ @Override
+ public byte[] getKey() {
+ return consumerRecord.key();
+ }
+
+ @Override
+ public byte[] getMessage() {
+ return consumerRecord.value();
+ }
+
+ @Override
+ public String getTopic() {
+ return consumerRecord.topic();
+ }
+
+ @Override
+ public int getPartition() {
+ return consumerRecord.partition();
+ }
+
+ @Override
+ public long getOffset() {
+ return consumerRecord.offset();
+ }
+
+ @Override
+ public long getTimestamp() {
+ return Long.MIN_VALUE;
--- End diff --
Yes, it certainly does, it should return the `consumerRecord.timestamp()`.
I'll fix it.
> Get the timestamp of the Kafka message from kafka consumer(Kafka010Fetcher)
> ---------------------------------------------------------------------------
>
> Key: FLINK-8500
> URL: https://issues.apache.org/jira/browse/FLINK-8500
> Project: Flink
> Issue Type: Improvement
> Components: Kafka Connector
> Affects Versions: 1.4.0
> Reporter: yanxiaobin
> Priority: Major
> Fix For: 1.6.0
>
> Attachments: image-2018-01-30-14-58-58-167.png,
> image-2018-01-31-10-48-59-633.png
>
>
> The method deserialize of KeyedDeserializationSchema needs a parameter
> 'kafka message timestamp' (from ConsumerRecord) .In some business scenarios,
> this is useful!
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)