Closed
Description
In the CamelSourceTask
, if a Camel's header is of type date, it gets propagated as a string to Kafka with something like:
if (value instanceof Date) {
record.headers().addString(
keyCamelHeader,
new SimpleDateFormat("yyyy-MM-dd").format(value));
}
this approach has some issues:
- the consumer is not able to know the real type of the header as it is just a string
- 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.
Metadata
Metadata
Assignees
Labels
No labels