[
https://issues.apache.org/jira/browse/FLUME-2799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15340125#comment-15340125
]
Lior Zeno commented on FLUME-2799:
----------------------------------
This is implemented in the new KafkaSource. See FLUME-2821.
{code:title=KafkaSource.java|borderStyle=solid}
if (!headers.containsKey(KafkaSourceConstants.TIMESTAMP_HEADER)) {
headers.put(KafkaSourceConstants.TIMESTAMP_HEADER,
String.valueOf(System.currentTimeMillis()));
}
if (!headers.containsKey(KafkaSourceConstants.TOPIC_HEADER)) {
headers.put(KafkaSourceConstants.TOPIC_HEADER, message.topic());
}
if (!headers.containsKey(KafkaSourceConstants.PARTITION_HEADER)) {
headers.put(KafkaSourceConstants.PARTITION_HEADER,
String.valueOf(message.partition()));
}
{code}
> Kafka Source - Message Offset and Partition add to headers
> ----------------------------------------------------------
>
> Key: FLUME-2799
> URL: https://issues.apache.org/jira/browse/FLUME-2799
> Project: Flume
> Issue Type: Improvement
> Components: Sinks+Sources
> Affects Versions: v1.6.0
> Reporter: Michael Andre Pearce (IG)
> Priority: Minor
> Labels: easyfix, patch
> Fix For: v1.7.0
>
> Attachments: FLUME-2799-0.patch
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Currently Kafka source only persists the original kafka message's topic into
> the Flume event headers.
> For downstream interceptors and sinks that may want to have available to them
> the partition and the offset , we need to add these.
> Also it is noted that the conversion from MessageAndMetaData to FlumeEvent is
> not configurable unlike other sources such as JMS.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)