[
https://issues.apache.org/jira/browse/BEAM-3851?focusedWorklogId=83258&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-83258
]
ASF GitHub Bot logged work on BEAM-3851:
----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Mar/18 17:40
Start Date: 22/Mar/18 17:40
Worklog Time Spent: 10m
Work Description: rangadi commented on a change in pull request #4868:
[BEAM-3851] Option to preserve element timestamp while publishing to Kafka.
URL: https://github.com/apache/beam/pull/4868#discussion_r176510499
##########
File path:
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaExactlyOnceSink.java
##########
@@ -190,12 +193,13 @@ public void setup() {
@ProcessElement
public void processElement(ProcessContext ctx) {
shardId = (shardId + 1) % numShards; // round-robin among shards.
- ctx.output(KV.of(shardId, ctx.element()));
+ ctx.output(KV.of(shardId, TimestampedValue.of(ctx.element(),
ctx.timestamp())));
Review comment:
It is done couple of stages later while writing to Kafka (line 438). The
timestamp here is element timestamp. I was wondering if we should invoke user
function here or later. One wrinkle if we want to do what you suggest is how to
carry default 'null' down stream. We could have an optional to carry it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 83258)
Time Spent: 1h 40m (was: 1.5h)
> Support element timestamps while publishing to Kafka.
> -----------------------------------------------------
>
> Key: BEAM-3851
> URL: https://issues.apache.org/jira/browse/BEAM-3851
> Project: Beam
> Issue Type: Improvement
> Components: io-java-kafka
> Affects Versions: 2.3.0
> Reporter: Raghu Angadi
> Assignee: Raghu Angadi
> Priority: Major
> Fix For: 2.5.0
>
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> KafkaIO sink should support using input element timestamp for the message
> published to Kafka. Otherwise there is no way for user to influence the
> timestamp of the messages in Kafka sink.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)