Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 18. Core
Camel core functionality and basic Camel languages/ Constant, ExchangeProperty, Header, Ref, Simple and Tokenize
18.1. What’s inside Link kopierenLink in die Zwischenablage kopiert!
Please refer to the above links for usage and configuration details.
18.2. Maven coordinates Link kopierenLink in die Zwischenablage kopiert!
Create a new project with this extension on code.quarkus.redhat.com
Or add the coordinates to your existing project:
<dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-core</artifactId> </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>
18.3. Additional Camel Quarkus configuration Link kopierenLink in die Zwischenablage kopiert!
18.3.1. Simple language Link kopierenLink in die Zwischenablage kopiert!
18.3.1.1. Using the OGNL notation Link kopierenLink in die Zwischenablage kopiert!
When using the OGNL notation from the simple language, the camel-quarkus-bean
extension should be used.
For instance, the simple expression below is accessing the getAddress()
method on the message body of type Client
.
--- simple("${body.address}") ---
---
simple("${body.address}")
---
In such a situation, one should take an additional dependency on the camel-quarkus-bean extension as described here. Note that in native mode, some classes may need to be registered for reflection. In the example above, the Client
class needs to be registered for reflection.
18.3.1.2. Using dynamic type resolution in native mode Link kopierenLink in die Zwischenablage kopiert!
When dynamically resolving a type from simple expressions like:
-
simple("${mandatoryBodyAs(TYPE)}")
-
simple("${type:package.Enum.CONSTANT}")
-
from("…").split(bodyAs(TYPE.class))
-
simple("${body} is TYPE")
It may be needed to register some classes for reflection manually.
For instance, the simple expression below is dynamically resolving the type java.nio.ByteBuffer
at runtime:
--- simple("${body} is 'java.nio.ByteBuffer'") ---
---
simple("${body} is 'java.nio.ByteBuffer'")
---
As such, the class java.nio.ByteBuffer
needs to be registered for reflection.
18.3.1.3. Using the simple language with classpath resources in native mode Link kopierenLink in die Zwischenablage kopiert!
If your route is supposed to load a Simple script from classpath, like in the following example
from("direct:start").transform().simple("resource:classpath:mysimple.txt");
from("direct:start").transform().simple("resource:classpath:mysimple.txt");
then you need to use Quarkus quarkus.native.resources.includes
property to include the resource in the native executable as demonstrated below:
quarkus.native.resources.includes = mysimple.txt
quarkus.native.resources.includes = mysimple.txt
18.3.1.4. Configuring a custom bean via properties in native mode Link kopierenLink in die Zwischenablage kopiert!
When specifying a custom bean via properties in native mode with configuration like #class:*
or #type:*
, it may be needed to register some classes for reflection manually.
For instance, the custom bean definition below involves the use of reflection for bean instantiation and setter invocation:
--- camel.beans.customBeanWithSetterInjection = #class:org.example.PropertiesCustomBeanWithSetterInjection camel.beans.customBeanWithSetterInjection.counter = 123 ---
---
camel.beans.customBeanWithSetterInjection = #class:org.example.PropertiesCustomBeanWithSetterInjection
camel.beans.customBeanWithSetterInjection.counter = 123
---
As such, the class PropertiesCustomBeanWithSetterInjection
needs to be registered for reflection, note that field access could be omitted in this case.
Configuration property | Type | Default |
---|---|---|
When set to true, the |
|
|
A comma-separated list of Ant-path style patterns to match Camel service definition files in the classpath. The services defined in the matching files will not be discoverable via the |
| |
A comma-separated list of Ant-path style patterns to match Camel service definition files in the classpath. The services defined in the matching files will be discoverable via the |
| |
A comma-separated list of Ant-path style patterns to match Camel service definition files in the classpath. The services defined in the matching files will not be added to Camel registry during application’s static initialization. The excludes have higher precedence than includes. The excludes defined here can also be used to veto the registration of services included by Camel Quarkus extensions. Example values: |
| |
A comma-separated list of Ant-path style patterns to match Camel service definition files in the classpath. The services defined in the matching files will be added to Camel registry during application’s static initialization unless the given file is excluded via |
| |
If |
|
|
If |
|
|
If |
|
|
If |
|
|
Enable automatic discovery of routes during static initialization. |
|
|
Used for exclusive filtering scanning of RouteBuilder classes. The exclusive filtering takes precedence over inclusive filtering. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma. For example to exclude all classes starting with Bar use: **/Bar* To exclude all routes form a specific package use: com/mycompany/bar/* To exclude all routes form a specific package and its sub-packages use double wildcards: com/mycompany/bar/** And to exclude all routes from two specific packages use: com/mycompany/bar/*,com/mycompany/stuff/* |
| |
Used for inclusive filtering scanning of RouteBuilder classes. The exclusive filtering takes precedence over inclusive filtering. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma. For example to include all classes starting with Foo use: **/Foo* To include all routes form a specific package use: com/mycompany/foo/* To include all routes form a specific package and its sub-packages use double wildcards: com/mycompany/foo/** And to include all routes from two specific packages use: com/mycompany/foo/*,com/mycompany/stuff/* |
| |
Replaced by |
| |
Replaced by |
| |
A comma separated list of Ant-path style patterns to match class names that should be excluded from registering for reflection. Use the class name format as returned by the |
| |
A comma separated list of Ant-path style patterns to match class names that should be registered for reflection. Use the class name format as returned by the |
| |
If |
|
|
What to do if it is not possible to extract CSimple expressions from a route definition at build time. |
|
|
Whether to enable the bridging of Camel events to CDI events. This allows CDI observers to be configured for Camel events. E.g. those belonging to the |
|
|
Build time configuration options for enable/disable camel source location |
|
|
A timeout (with millisecond precision) to wait for |
|
|
The action to take when |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.