Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support camel type converter #34

Merged
merged 2 commits into from
Dec 10, 2019
Merged

Support camel type converter #34

merged 2 commits into from
Dec 10, 2019

Conversation

omarsmak
Copy link
Member

This shall address #16. It will initialize the default Camel type registry upon starting the connector. To use it, you can add the following to the .properties file as an example:

transforms=CamelTypeConverterTransformer
transforms.CamelTypeConverterTransformer.type=org.apache.camel.kafkaconnector.transforms.CamelTypeConverterTransform$Value
transforms.CamelTypeConverterTransformer.target.type = java.lang.Float

Whereby you can change org.apache.camel.kafkaconnector.transforms.CamelTypeConverterTransform$Value to convert the value of a connect record with org.apache.camel.kafkaconnector.transforms.CamelTypeConverterTransform$Key to convert the key of a connect record.
target.type is the full qualified java name for the type you want to convert to.

This transformer will try its best to populate the correct schema for the corresponding type. However, in case the type of the value is unknown, it will by default included it as BYTES schema.

P/S: There are maybe some checkstyle errors as I think the checksyle profile is not included yet?

@oscerd
Copy link
Contributor

oscerd commented Dec 10, 2019

This is really nice. Thanks a lot!

@oscerd oscerd merged commit d4cd2b7 into master Dec 10, 2019
@oscerd
Copy link
Contributor

oscerd commented Dec 10, 2019

Yes, probably there are checkstyle violations, but we'll fix them once we add the needed bits

@omarsmak omarsmak deleted the support-camel-type-converter branch December 10, 2019 19:28
@omarsmak
Copy link
Member Author

No problems. I will try to improve on it as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants