lburgazzoli opened a new issue #544:
URL: https://github.com/apache/camel-kafka-connector/issues/544


   In the `CamelSourceTask`, if a Camel's header is of type date, it gets 
propagated as a string to Kafka with something like:
   
   ```java
   if (value instanceof Date) {
       record.headers().addString(
           keyCamelHeader, 
           new SimpleDateFormat("yyyy-MM-dd").format(value));
   }
   ```
   
   this approach has some issues:
   
   1. the consumer is not able to know the real type of the header as it is 
just a string
   2. we lose precision as we remove the time of the day
   
   As Kafka support date and time with 
`org.apache.kafka.connect.data.[Data|Time]`, we should probably avoid to use a 
string to represent dates however to fully translate a `java.util.Date` to the 
related Kafka types, we'd need to split it to multiple headers keys or using 
multiple headers for the same value.
   
   I don't have enough knowledge at the moment about what could be the best 
solution but at least we should start by not losing the type.  
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to