apache / camel-kafka-connector

Camel Kafka Connector allows you to use all Camel components as Kafka Connect connectors
https://camel.apache.org
Apache License 2.0
152 stars 100 forks source link

Camel type converter is not able to handle null payload #269

Open rgannu opened 4 years ago

rgannu commented 4 years ago

Camel type converter gives the following exception when it encounters null in the payload. I am using the camel-file-sink-connector to dump the kafka message. The kafka message comes from the postgresql database using Debezium source connector.


A database DELETE operation causes Debezium to generate two Kafka records:

This null value needs to be handled by the converter.

connect_1 | Caused by: org.apache.kafka.connect.errors.DataException: CamelTypeConverter was not able to converter value null to target type of String connect_1 | at org.apache.camel.kafkaconnector.transforms.CamelTypeConverterTransform.convertValueWithCamelTypeConverter(CamelTypeConverterTransform.java:57) connect_1 | at org.apache.camel.kafkaconnector.transforms.CamelTypeConverterTransform.apply(CamelTypeConverterTransform.java:47) connect_1 | at org.apache.kafka.connect.runtime.TransformationChain.lambda$apply$0(TransformationChain.java:50)

oscerd commented 4 years ago

For this kind of stuff, you could write your own converter, the camel converter for File is not developed for dealing with Debezium. Camel-Kafka-connector is built upon Camel, but Camel has its own mechanism.