oscerd opened a new pull request, #1855: URL: https://github.com/apache/camel-kafka-connector/pull/1855
Fixes #269. ### Problem `CamelTypeConverterTransform` cannot handle a tombstone. With a null value, Camel's type converter returns null and the SMT throws: ``` org.apache.kafka.connect.errors.DataException: CamelTypeConverter was not able to convert a value of type `null` to target type of `String` ``` While reproducing this on 4.22.0, I found a second failure. Every schemaless record (for example one read with `value.converter.schemas.enable=false`) fails, because the SMT always copies the original schema: ``` java.lang.NullPointerException: Cannot invoke "org.apache.kafka.connect.data.Schema.name()" because "source" is null ``` ### Change - A null key or value is passed through unchanged, the way Kafka's `Cast` SMT does it. - A schemaless record stays schemaless. The converted value is set and the schema stays `null`. - The SMT had no documentation. A reference page (`reference/transformers/camelTypeConverter.adoc`) is added, linked from the nav and from the transformers index. ### Tests - `CamelTypeConverterTransformTest#testIfItPassesNullValuesThrough` covers a tombstone with and without a schema, and a record without a key. - `CamelTypeConverterTransformTest#testIfItConvertsSchemalessRecords` covers a schemaless key and value. - Both new tests fail on `main` with the errors above. `./mvnw -pl core -Psourcecheck install` runs 129 tests with 0 failures, and the full reactor build `./mvnw clean verify -DskipTests` succeeds. _Claude Code on behalf of Andrea Cosentino_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
