You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/04/08 13:39:43 UTC

[GitHub] [camel] omarsmak commented on a change in pull request #5312: "CAMEL-16414:camel-kafka set custom timestamp"

omarsmak commented on a change in pull request #5312:
URL: https://github.com/apache/camel/pull/5312#discussion_r609709989



##########
File path: components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaProducerTest.java
##########
@@ -302,6 +306,21 @@ public void processSendsMessageWithMessageKeyHeader() throws Exception {
         assertRecordMetadataExists();
     }
 
+    @Test
+    public void processSendsMessageWithMessageTimestampHeader() throws Exception {

Review comment:
       If possible, would be nice to add one more test to test nested `OVERRIDE_TIMESTAMP` in nested messages, it is related to the observation here: https://github.com/apache/camel/pull/5312/files#r609685918

##########
File path: components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
##########
@@ -223,6 +231,12 @@ public boolean hasNext() {
                             }
                         }
 
+                        if (innerMmessage.getHeader(KafkaConstants.OVERRIDE_TIMESTAMP) != null) {
+                            if (innerMmessage.getHeader(KafkaConstants.OVERRIDE_TIMESTAMP) instanceof Long) {
+                                innerTimestamp = ((Long) overrideTimeStamp).longValue();

Review comment:
       yes @vgaur , the `innerTimestamp` should get `innerMmessage.removeHeader(KafkaConstants.OVERRIDE_TIMESTAMP)` since now we are dealing here with inner messages




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org