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
Unmarshal json in spring xml #543
Comments
We don't support defining routes through spring xml at least at this stage so I'd recommend to use "routes fragments" (see the example https://github.com/apache/camel-quarkus/tree/master/examples/timer-log-xml). |
Yes. That's exactly what I did. Unfortunetaly I can't create data formats in route fragment and hence I used
But this doesn't work correctly. Is that the right way to unmarshal json to pojo in spring xml, or should I try something else? |
You can create data formats programmatically using java i.e. CDI/Spring beans but what you wrote should work, what is the error ? |
Object is created but all fields are not populated with data from json. |
does this happen in JVM or native mode ? |
This happens in JVM Here is the route:
POJO:
and stacktrace:
|
Do you have a repository/reproducer we can have a look at ? |
https://github.com/jstakun/wildwest-bot/ After you pull/fork:
For backend creation on Openshift you can use following commands:
|
I'vre created some tests: And an example: If you clone the example repo, then:
the log should show something like:
The issue is that, to use OGNL like paths you also need camel-quarkus-bean in the classpath |
Thanks. Adding camel-quarkus-bean to the pom deps solved this issue |
I'm trying to migrate spring xml route to quarkus camel. Everything works except for json unmarshaling.
In original version I've configured data format in camel context:
...
and the I'm calling it in the route:
<unmarshal ref="transform-game"/>
In quarkus version I don't know how to declare dataFormats beacuse in the example camel context is declared in application.properties and not in the xml hence I'm declaring it in the route:
However this doesn't seem to unmarshal json body to pojo.
Can you advice proper syntax?
The text was updated successfully, but these errors were encountered: