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

Replace quarkus.camel.native.resources.* with quarkus.native.resource… #2813

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/modules/ROOT/pages/migration-guide/2.0.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ The empty `camel-quarkus-main` artifact was removed completely in Camel Quarkus

As long as your application depends on any other Camel Quarkus extension, it is enough to remove the `camel-quarkus-main` dependency.
This is because all Camel Quarkus extensions transitively depend on `camel-quarkus-core` where the the original `camel-quarkus-main` functionality is hosted now.

== `quarkus.camel.native.resources.*` replaced by `quarkus.native.resources.includes`

The `quarkus.camel.native.resources.include-patterns` and `quarkus.camel.native.resources.exclude-patterns` configuration properties were removed in Camel Quarkus 2.0.0.
Please use `quarkus.native.resources.includes` and `quarkus.native.resources.excludes` instead respectively.
16 changes: 9 additions & 7 deletions docs/modules/ROOT/pages/reference/extensions/core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,23 @@ simple("${body} is 'java.nio.ByteBuffer'")
As such, the class `java.nio.ByteBuffer` needs to be link:https://quarkus.io/guides/writing-native-applications-tips#registering-for-reflection[registered for reflection].

==== Using the simple language with classpath resources in native mode
Beyond standard usages, a trick is needed when using the simple language with classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option.

For instance, the route below would load a simple script from a classpath resource named _mysimple.txt_:
If your route is supposed to load a Simple script from classpath, like in the following example

[source,java]
----
from("direct:start").transform().simple("resource:classpath:mysimple.txt");
----

In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below :
then you need to use Quarkus `quarkus.native.resources.includes` property to include the resource in the native executable
as demonstrated below:

[source,properties]
----
quarkus.camel.native.resources.include-patterns = *.txt
quarkus.native.resources.includes = mysimple.txt
----

More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].
More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].


[width="100%",cols="80,5,15",options="header"]
Expand Down Expand Up @@ -182,13 +184,13 @@ Used for inclusive filtering scanning of RouteBuilder classes. The exclusive fil

|icon:lock[title=Fixed at build time] [[quarkus.camel.native.resources.exclude-patterns]]`link:#quarkus.camel.native.resources.exclude-patterns[quarkus.camel.native.resources.exclude-patterns]`

A comma separated list of Ant-path style patterns to match resources that should be excluded from the native executable. By default, resources not selected by quarkus itself are ignored. Then, inclusion of additional resources could be triggered with `includePatterns`. When the inclusion patterns is too large, eviction of previously selected resources could be triggered with `excludePatterns`.
Replaced by `quarkus.native.resources.excludes` in Camel Quarkus 2.0.0. Using this property throws an exception at build time.
| `string`
|

|icon:lock[title=Fixed at build time] [[quarkus.camel.native.resources.include-patterns]]`link:#quarkus.camel.native.resources.include-patterns[quarkus.camel.native.resources.include-patterns]`

A comma separated list of Ant-path style patterns to match resources that should be included in the native executable. By default, resources not selected by quarkus itself are ignored. Then, inclusion of additional resources could be triggered with `includePatterns`. When the inclusion patterns is too large, eviction of previously selected resources could be triggered with `excludePatterns`.
Replaced by `quarkus.native.resources.includes` in Camel Quarkus 2.0.0. Using this property throws an exception at build time.
| `string`
|

Expand Down
14 changes: 9 additions & 5 deletions docs/modules/ROOT/pages/reference/extensions/flatpack.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,23 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ

== Additional Camel Quarkus configuration

Beyond standard usages described above, a trick is needed when using flatpack mappings from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option.
This component typically loads Flatpack mappings from classpath.
To make it work also in native mode, you need to explicitly embed the mappings in the native executable
by using the `quarkus.native.resources.includes` property.

For instance, the route below loads the Flatpack mappings from a classpath resource named `mappings/simple.pzmap.xml`:

For instance, the route below would load the flatpack mapping from a classpath resource named _mappings/simple.pzmap.xml_:
[source,java]
----
from("direct:start").to("flatpack:delim:mappings/simple.pzmap.xml");
----

In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below :
To include this (an possibly other mappings stored in `.pzmap.xml` files under the `mappings` directory) in the native image, you would have to add something like the following to your `application.properties` file:

[source,properties]
----
quarkus.camel.native.resources.include-patterns = mappings/*.pzmap.xml
quarkus.native.resources.includes = mappings/*.pzmap.xml
----

More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].
More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].

Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ

== Usage

This extension leverages the Quarkiverse Google Cloud Services extension. The https://github.com/quarkiverse/quarkiverse-google-cloud-services[documentation] describes
how to configure authentication for Google cloud services.
This extension leverages the Quarkiverse Google Cloud Services extension.
The https://github.com/quarkiverse/quarkiverse-google-cloud-services[documentation] describes how to configure authentication for Google cloud services.

For convenience, a `GoogleBigQueryConnectionFactory` for use by the `google-bigquery` & `google-bigquery-sql` component is automatically configured.

If you want to read SQL scripts from the classpath with `google-bigquery-sql` in native mode, then you will need to ensure that they are added to the native image via
the `quarkus.camel.native.resources.include-patterns` configuration property.
If you want to read SQL scripts from the classpath with `google-bigquery-sql` in native mode,
then you will need to ensure that they are added to the native image via the `quarkus.native.resources.includes` configuration property.
Please check https://quarkus.io/guides/building-native-image#quarkus-native-pkg-native-config_quarkus.native.resources.includes[Quarkus documentation] for more details.

14 changes: 9 additions & 5 deletions docs/modules/ROOT/pages/reference/extensions/jing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,23 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ

== Additional Camel Quarkus configuration

Beyond standard usages described above, a trick is needed when using jing schemas from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option.
This component typically loads schemas from classpath resources.
To make it work also in native mode, you need to explicitly embed the schema files in the native executable
by using the `quarkus.native.resources.includes` property.

For instance, the route below would load the Jing schema from a classpath resource named `schema.rng`:

For instance, the route below would load the jing schema from a classpath resource named _schema.rng_:
[source,java]
----
from("direct:start").to("jing:schema.rng");
----

In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below :
To include this (an possibly other schemas stored in `.rng` files) in the native image, you would have to add something like the following to your `application.properties` file:

[source,properties]
----
quarkus.camel.native.resources.include-patterns = *.rng
quarkus.native.resources.includes = *.rng
----

More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].
More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].

14 changes: 9 additions & 5 deletions docs/modules/ROOT/pages/reference/extensions/jolt.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,23 @@ The `allowContextMapAll` option is not supported in native mode as it requires r

== Additional Camel Quarkus configuration

Beyond standard usages described above, a trick is needed when using jolt specs from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option.
This component typically loads its specs from classpath resources.
To make it work also in native mode, you need to explicitly embed the spec files in the native executable
by using the `quarkus.native.resources.includes` property.

For instance, the route below would load the Jolt spec from a classpath resource named `defaultr.json`:

For instance, the route below would load the jolt spec from a classpath resource named _defaultr.json_:
[source,java]
----
from("direct:start").to("jolt:defaultr.json");
----

In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below :
To include this (an possibly other specs stored in `.json` files) in the native image, you would have to add something like the following to your `application.properties` file:

[source,properties]
----
quarkus.camel.native.resources.include-patterns = *.json
quarkus.native.resources.includes = *.json
----

More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].
More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].

18 changes: 12 additions & 6 deletions docs/modules/ROOT/pages/reference/extensions/jslt.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,30 @@ The `allowContextMapAll` option is not supported in native mode as it requires r

== Additional Camel Quarkus configuration

=== Using JSLT templates from classpath resource in native mode
A trick is needed when using JSLT templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option.
=== Loading JSLT templates from classpath in native mode

This component typically loads the templates from classpath.
To make it work also in native mode, you need to explicitly embed the templates files in the native executable
by using the `quarkus.native.resources.includes` property.

For instance, the route below would load the JSLT schema from a classpath resource named `transformation.json`:

For instance, the route below would load the JSLT schema from a classpath resource named _transformation.json_:
[source,java]
----
from("direct:start").to("jslt:transformation.json");
----

In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below :
To include this (an possibly other templates stored in `.json` files) in the native image, you would have to add something like the following to your `application.properties` file:

[source,properties]
----
quarkus.camel.native.resources.include-patterns = *.json
quarkus.native.resources.includes = *.json
----

More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].
More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].

=== Using JSLT functions in native mode

When using JSLT functions from camel-quarkus in native mode, the classes hosting the functions would need to be link:https://quarkus.io/guides/writing-native-applications-tips#registering-for-reflection[registered for reflection]. When registering the target function is not possible, one may end up writing a stub as below.
----
@RegisterForReflection
Expand Down
14 changes: 9 additions & 5 deletions docs/modules/ROOT/pages/reference/extensions/json-validator.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,23 @@ The `allowContextMapAll` option is not supported in native mode as it requires r

== Additional Camel Quarkus configuration

Beyond standard usages described above, a trick is needed when using json-validator templates from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option.
This component typically loads JSON schemas from classpath.
To make it work also in native mode, you need to explicitly embed the schema files in the native executable
by using the `quarkus.native.resources.includes` property.

For instance, the route below would load the schema from a classpath resource named `schema.json`:

For instance, the route below would load the json-validator template from a classpath resource named _schema.json_:
[source,java]
----
from("direct:start").to("json-validator:schema.json");
----

In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below :
To include this (an possibly other schemas stored in `.json` files) in the native image, you would have to add something like the following to your `application.properties` file:

[source,properties]
----
quarkus.camel.native.resources.include-patterns = schema.json
quarkus.native.resources.includes = schema.json
----

More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].
More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].

13 changes: 7 additions & 6 deletions docs/modules/ROOT/pages/reference/extensions/jsonata.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,21 @@ The `allowContextMapAll` option is not supported in native mode as it requires r

== Additional Camel Quarkus configuration

=== Using specifications from classpath resource in native mode
A trick is needed when using specifications from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option.
This component typically loads JSONata specifications from classpath.
To make it work also in native mode, you need to explicitly embed the specification files in the native executable
by using the `quarkus.native.resources.includes` property.

For instance, the route below would load the specification from a classpath resource named _spec/expressions.spec_:
[source,java]
----
from("direct:start").to("jsonata:spec/expressions.spec");
----

In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below :
To include this (an possibly other specifications stored in `.spec` files) in the native image, you would have to add something like the following to your `application.properties` file:

[source,properties]
----
quarkus.camel.native.resources.include-patterns = spec/*.spec
quarkus.native.resources.includes = spec/*.spec
----

More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].
More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].

13 changes: 8 additions & 5 deletions docs/modules/ROOT/pages/reference/extensions/msv.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,22 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ

== Additional Camel Quarkus configuration

Beyond standard usages described above, a trick is needed when using msv schemas from classpath resources in native mode. In such a situation, one needs to explicitly embed the resources in the native executable by specifying the `include-patterns` option.
This component typically loads XML schemas from classpath.
To make it work also in native mode, you need to explicitly embed the schema files in the native executable
by using the `quarkus.native.resources.includes` property.

For instance, the route below would load the msv schema from a classpath resource named _schema.rng_:
For instance, the route below would load the schema from a classpath resource named `schema.rng`:
[source,java]
----
from("direct:start").to("msv:schema.rng");
----

In order to work in native mode the `include-patterns` configuration should be set. For instance, in the `application.properties` file as below :
To include this (an possibly other schemas stored in `.rng` files) in the native image, you would have to add something like the following to your `application.properties` file:

[source,properties]
----
quarkus.camel.native.resources.include-patterns = *.rng
quarkus.native.resources.includes = *.rng
----

More information about selecting resources for inclusion in the native executable could be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].
More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resource in native executable].