camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CAMEL-12235) Add Timestamp to Message header from ConsumerRecord in the camel-kafka component
Date Wed, 07 Feb 2018 06:37:00 GMT


ASF GitHub Bot commented on CAMEL-12235:

oscerd closed pull request #2210: CAMEL-12235 - Added timestamp to message header

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/
index ee66c8350b1..545273d6536 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/
@@ -25,6 +25,7 @@
     public static final String OFFSET = "kafka.OFFSET";
     public static final String HEADERS = "kafka.HEADERS";
     public static final String LAST_RECORD_BEFORE_COMMIT = "kafka.LAST_RECORD_BEFORE_COMMIT";
+    public static final String TIMESTAMP = "kafka.TIMESTAMP";
     public static final String KAFKA_DEFAULT_ENCODER = "kafka.serializer.DefaultEncoder";
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/
index da2dc97cbb1..52e4ed54f08 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/
@@ -173,6 +173,7 @@ public Exchange createKafkaExchange(ConsumerRecord record) {
         message.setHeader(KafkaConstants.TOPIC, record.topic());
         message.setHeader(KafkaConstants.OFFSET, record.offset());
         message.setHeader(KafkaConstants.HEADERS, record.headers());
+        message.setHeader(KafkaConstants.TIMESTAMP, record.timestamp());
         if (record.key() != null) {
             message.setHeader(KafkaConstants.KEY, record.key());


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:

> Add Timestamp to Message header  from ConsumerRecord in the camel-kafka component 
> ----------------------------------------------------------------------------------
>                 Key: CAMEL-12235
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-kafka
>    Affects Versions: 2.21.0
>            Reporter: Anand Banik
>            Priority: Minor
>             Fix For: 2.21.0
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> Currently, the timestamp of the message produced by the publisher cannot be accessed
by the Message API in the custom processor where the message is being consumed. This improvement adds
the timestamp to the Message Header.

This message was sent by Atlassian JIRA

View raw message