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 dataformat configuration for marshaller/unmarshaller #816 #855

Closed
wants to merge 1 commit into from

Conversation

luigidemasi
Copy link
Contributor

this pr allow the configuration of a dataformat directly in properties file, something like:

camel.source.unmarshal=fhirJson
camel.source.unmarshal.fhirJson.fhirVersion=R4
camel.source.unmarshal.fhirJson.prettyPrint=true

Copy link
Contributor

@oscerd oscerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks a lot. @valdar cc

@oscerd
Copy link
Contributor

oscerd commented Jan 13, 2021

Can you fix the codestyle?


DataFormatDefinition dataformat;

switch (dataFormatName) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this switch case could be avoided by something on the line of context.createDataFormat(dataFormatName)

Copy link
Member

@valdar valdar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the general impression that this usecase should have worked already using something like:

camel.dataformat.fhirJson.fhirVersion=R4
camel.dataformat.fhirJson.prettyPrint=true

see https://github.com/apache/camel-kafka-connector/blob/master/core/src/test/java/org/apache/camel/kafkaconnector/DataFormatTest.java#L128
Give me some more time to investigate further.

@luigidemasi
Copy link
Contributor Author

luigidemasi commented Jan 13, 2021

I was under the general impression that this usecase should have worked already using something like:

camel.dataformat.fhirJson.fhirVersion=R4
camel.dataformat.fhirJson.prettyPrint=true

see https://github.com/apache/camel-kafka-connector/blob/master/core/src/test/java/org/apache/camel/kafkaconnector/DataFormatTest.java#L128
Give me some more time to investigate further.

It should work but it doesn't, if you look at the test, you disable validation and then assert that the validation is enabled.
I think it's a bug on camel-main atuoconfiguration that doesn't bind the dataformat in the registry after configuring it and an empty new one is created when the route starts. Opened an issue for this: CAMEL-16032

@valdar
Copy link
Member

valdar commented Jan 14, 2021

Thanks a lot for the effort in seeking the root cause of this and fixing it @luigidemasi !
I close this and the effort is tracked here: #816

@valdar valdar closed this Jan 14, 2021
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.

None yet

3 participants