| // Do not edit directly! |
| // This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page |
| = JQ |
| :linkattrs: |
| :cq-artifact-id: camel-quarkus-jq |
| :cq-native-supported: true |
| :cq-status: Stable |
| :cq-status-deprecation: Stable |
| :cq-description: Evaluates a JQ expression against a JSON message body. |
| :cq-deprecated: false |
| :cq-jvm-since: 2.11.0 |
| :cq-native-since: 2.11.0 |
| |
| [.badges] |
| [.badge-key]##JVM since##[.badge-supported]##2.11.0## [.badge-key]##Native since##[.badge-supported]##2.11.0## |
| |
| Evaluates a JQ expression against a JSON message body. |
| |
| == What's inside |
| |
| * xref:{cq-camel-components}:languages:jq-language.adoc[JQ language] |
| |
| Please refer to the above link for usage and configuration details. |
| |
| == Maven coordinates |
| |
| https://code.quarkus.io/?extension-search=camel-quarkus-jq[Create a new project with this extension on code.quarkus.io, window="_blank"] |
| |
| Or add the coordinates to your existing project: |
| |
| [source,xml] |
| ---- |
| <dependency> |
| <groupId>org.apache.camel.quarkus</groupId> |
| <artifactId>camel-quarkus-jq</artifactId> |
| </dependency> |
| ---- |
| |
| Check the xref:user-guide/index.adoc[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: |
| |
| [source,java] |
| ---- |
| @RegisterForReflection |
| public class Book { |
| ... |
| } |
| ---- |
| |
| [source,java] |
| ---- |
| public class MyJQRoutes extends RouteBuilder { |
| @Override |
| public void configure() { |
| from("direct:jq") |
| .transform().jq(".book", Book.class); |
| } |
| } |
| ---- |
| |
| Refer to the xref:user-guide/native-mode.adoc#reflection[Native mode] user guide for more information. |
| |