[
https://issues.apache.org/jira/browse/CAMEL-12235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355027#comment-16355027
]
ASF GitHub Bot commented on CAMEL-12235:
----------------------------------------
oscerd closed pull request #2210: CAMEL-12235 - Added timestamp to message
header
URL: https://github.com/apache/camel/pull/2210
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/KafkaConstants.java
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConstants.java
index ee66c8350b1..545273d6536 100644
---
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConstants.java
+++
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConstants.java
@@ -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";
@Deprecated
public static final String KAFKA_DEFAULT_ENCODER =
"kafka.serializer.DefaultEncoder";
diff --git
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
index da2dc97cbb1..52e4ed54f08 100644
---
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
+++
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
@@ -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:
[email protected]
> Add Timestamp to Message header from ConsumerRecord in the camel-kafka
> component
> ----------------------------------------------------------------------------------
>
> Key: CAMEL-12235
> URL: https://issues.apache.org/jira/browse/CAMEL-12235
> 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
(v7.6.3#76005)