JQ
JVM since2.11.0 Native since2.11.0
Evaluates a JQ expression against a JSON message body.
Maven coordinates
Or add the coordinates to your existing project:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jq</artifactId>
</dependency>
Check the User guide for more information about writing Camel Quarkus applications.
Usage
JQ transformations to custom result types in native mode
If you choose to perform JQ transformations that specify the result class as some custom type in native mode, then you must register that type for reflection.
E.g via the @RegisterForReflection
annotation or configuration property quarkus.camel.native.reflection.include-patterns
. For example:
@RegisterForReflection
public class Book {
...
}
public class MyJQRoutes extends RouteBuilder {
@Override
public void configure() {
from("direct:jq")
.transform().jq(".book", Book.class);
}
}
Refer to the Native mode user guide for more information.