Chapter 2. Extensions reference
This chapter provides reference information about Camel Extensions for Quarkus.
2.1. Attachments
Support for attachments on Camel messages
2.1.1. What’s inside
Please refer to the above link for usage and configuration details.
2.1.2. Maven coordinates
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-attachments</artifactId> </dependency>
2.2. Avro
Serialize and deserialize messages using Apache Avro binary data format.
2.2.1. What’s inside
Please refer to the above link for usage and configuration details.
2.2.2. Maven coordinates
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-avro</artifactId> </dependency>
2.2.3. Additional Camel Quarkus configuration
Beyond standard usages known from vanilla Camel, Camel Quarkus adds the possibility to parse the Avro schema at build time both in JVM and Native mode.
The approach to generate Avro classes from Avro schema files is the one coined by the quarkus-avro
extension. It requires the following:
-
Store
*.avsc
files in a folder namedsrc/main/avro
orsrc/test/avro
In addition to the usual
build
goal ofquarkus-maven-plugin
, add thegenerate-code
goal:<plugin> <groupId>io.quarkus</groupId> <artifactId>quarkus-maven-plugin</artifactId> <executions> <execution> <id>generate-code-and-build</id> <goals> <goal>generate-code</goal> <goal>build</goal> </goals> </execution> </executions> </plugin>
Please see a working configuration in Camel Quarkus Avro integration test and Quarkus Avro integration test.
2.3. Avro Jackson
Marshal POJOs to Avro and back using Jackson.
2.3.1. What’s inside
Please refer to the above link for usage and configuration details.
2.3.2. Maven coordinates
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-jackson-avro</artifactId> </dependency>
2.4. AWS 2 DynamoDB
Store and retrieve data from AWS DynamoDB service or receive messages from AWS DynamoDB Stream using AWS SDK version 2.x.
2.4.1. What’s inside
-
AWS DynamoDB component, URI syntax:
aws2-ddb:tableName
-
AWS DynamoDB Streams component, URI syntax:
aws2-ddbstream:tableName
Please refer to the above links for usage and configuration details.
2.4.2. Maven coordinates
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-aws2-ddb</artifactId> </dependency>
2.4.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.4.4. Additional Camel Quarkus configuration
2.4.4.1. Optional integration with Quarkus Amazon DynamoDB
If desired, it is possible to use the Quarkus Amazon DynamoDB extension in conjunction with Camel Quarkus AWS 2 DynamoDB. Note that this is fully optional and not mandatory at all. Please follow the Quarkus documentation but beware of the following caveats:
The client type
apache
has to be selected by configuring the following property:quarkus.dynamodb.sync-client.type=apache
The
DynamoDbClient
has to be "unremovable" in the sense of Quarkus CDI reference so that Camel Quarkus is able to look it up at runtime. You can reach that, for example, by adding a dummy bean injectingDynamoDbClient
:import javax.enterprise.context.ApplicationScoped; import io.quarkus.arc.Unremovable; import software.amazon.awssdk.services.dynamodb.DynamoDbClient; @ApplicationScoped @Unremovable class UnremovableDynamoDbClient { @Inject DynamoDbClient dynamoDbClient; }
2.5. AWS 2 Kinesis
Consume and produce records from AWS Kinesis Streams using AWS SDK version 2.x.
2.5.1. What’s inside
-
AWS Kinesis component, URI syntax:
aws2-kinesis:streamName
-
AWS Kinesis Firehose component, URI syntax:
aws2-kinesis-firehose:streamName
Please refer to the above links for usage and configuration details.
2.5.2. Maven coordinates
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-aws2-kinesis</artifactId> </dependency>
2.5.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.6. AWS 2 Lambda
Manage and invoke AWS Lambda functions using AWS SDK version 2.x.
2.6.1. What’s inside
-
AWS Lambda component, URI syntax:
aws2-lambda:function
Please refer to the above link for usage and configuration details.
2.6.2. Maven coordinates
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-aws2-lambda</artifactId> </dependency>
2.6.3. Camel Quarkus limitations
The getAlias
and listAliases
operations need to be used with pojoRequest
in order to work. It implies that the request for those operations should be explicitly constructed by hand as shown below.
Example of creating a getAlias
request by hand:
.process(new Processor() { public void process(Exchange exchange) { GetAliasRequest getAliasRequest = GetAliasRequest.builder().functionName(functionName).name(aliasName).build(); exchange.getIn().setBody(getAliasRequest); }}) .to("aws2-lambda:functionName?operation=getAlias&pojoRequest=true");
Example of creating a listAliases
request by hand:
.process(new Processor() { public void process(Exchange exchange) { ListAliasesRequest listAliasesRequest = ListAliasesRequest.builder().functionName(functionName).build(); exchange.getIn().setBody(listAliasesRequest); }}) .to("aws2-lambda:functionName?operation=listAliases&pojoRequest=true");
2.6.4. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.6.5. Additional Camel Quarkus configuration
2.6.5.1. Not possible to leverage quarkus-amazon-lambda by Camel aws2-lambda extension
The quarkus-amazon-lambda
extension allows you to use Quarkus to build your AWS Lambdas, whereas Camel component manages (deploy, undeploy, …) existing functions. Therefore, it is not possible to use quarkus-amazon-lambda
as a client for Camel aws2-lambda
extension.
2.7. AWS 2 S3 Storage Service
Store and retrieve objects from AWS S3 Storage Service using AWS SDK version 2.x.
2.7.1. What’s inside
-
AWS S3 Storage Service component, URI syntax:
aws2-s3://bucketNameOrArn
Please refer to the above link for usage and configuration details.
2.7.2. Maven coordinates
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-aws2-s3</artifactId> </dependency>
2.7.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.7.4. Additional Camel Quarkus configuration
2.7.4.1. Optional integration with Quarkus Amazon S3
If desired, it is possible to use the Quarkus Amazon S3 extension in conjunction with Camel Quarkus AWS 2 S3 Storage Service. Note that this is fully optional and not mandatory at all. Please follow the Quarkus documentation but beware of the following caveats:
The client type
apache
has to be selected by configuring the following property:quarkus.s3.sync-client.type=apache
The
S3Client
has to be "unremovable" in the sense of Quarkus CDI reference so that Camel Quarkus is able to look it up at runtime. You can reach that, for example, by adding a dummy bean injectingS3Client
:import javax.enterprise.context.ApplicationScoped; import io.quarkus.arc.Unremovable; import software.amazon.awssdk.services.s3.S3Client; @ApplicationScoped @Unremovable class UnremovableS3Client { @Inject S3Client s3Client; }
If you use the camel-quarkus-aws2-s3
extension to create a download link with Browser Compatibility, you must disable checksum validation explicity to avoid a HTTP 403 Forbidden error when using the HTTP GET request:
quarkus.s3.checksum-validation=false
2.8. AWS 2 Simple Notification System (SNS)
Send messages to an AWS Simple Notification Topic using AWS SDK version 2.x.
2.8.1. What’s inside
-
AWS Simple Notification System (SNS) component, URI syntax:
aws2-sns:topicNameOrArn
Please refer to the above link for usage and configuration details.
2.8.2. Maven coordinates
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-aws2-sns</artifactId> </dependency>
2.8.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.8.4. Additional Camel Quarkus configuration
2.8.4.1. Optional integration with Quarkus Amazon SNS
If desired, it is possible to use the Quarkus Amazon SNS extension in conjunction with Camel Quarkus AWS 2 Simple Notification System (SNS). Note that this is fully optional and not mandatory at all. Please follow the Quarkus documentation but beware of the following caveats:
The client type
apache
has to be selected by configuring the following property:quarkus.sns.sync-client.type=apache
The
SnsClient
has to be made "unremovable" in the sense of Quarkus CDI reference so that Camel Quarkus is able to look it up at runtime. You can reach that e.g. by adding a dummy bean injectingSnsClient
:import javax.enterprise.context.ApplicationScoped; import io.quarkus.arc.Unremovable; import software.amazon.awssdk.services.sns.SnsClient; @ApplicationScoped @Unremovable class UnremovableSnsClient { @Inject SnsClient snsClient; }
2.9. AWS 2 Simple Queue Service (SQS)
Sending and receive messages to/from AWS SQS service using AWS SDK version 2.x.
2.9.1. What’s inside
-
AWS Simple Queue Service (SQS) component, URI syntax:
aws2-sqs:queueNameOrArn
Please refer to the above link for usage and configuration details.
2.9.2. Maven coordinates
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-aws2-sqs</artifactId> </dependency>
2.9.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.9.4. Additional Camel Quarkus configuration
2.9.4.1. Optional integration with Quarkus Amazon SQS
If desired, it is possible to use the Quarkus Amazon SQS extension in conjunction with Camel Quarkus AWS 2 Simple Queue Service (SQS). Note that this is fully optional and not mandatory at all. Please follow the Quarkus documentation but beware of the following caveats:
The client type
apache
has to be selected by configuring the following property:quarkus.sqs.sync-client.type=apache
The
SqsClient
has to be made "unremovable" in the sense of Quarkus CDI reference so that Camel Quarkus is able to look it up at runtime. You can reach that e.g. by adding a dummy bean injectingSqsClient
:import javax.enterprise.context.ApplicationScoped; import io.quarkus.arc.Unremovable; import software.amazon.awssdk.services.sqs.SqsClient; @ApplicationScoped @Unremovable class UnremovableSqsClient { @Inject SqsClient sqsClient; }
2.10. Azure Storage Blob Service
Store and retrieve blobs from Azure Storage Blob Service using SDK v12.
2.10.1. What’s inside
-
Azure Storage Blob Service component, URI syntax:
azure-storage-blob:accountName/containerName
Please refer to the above link for usage and configuration details.
2.10.2. Maven coordinates
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-azure-storage-blob</artifactId> </dependency>
2.10.3. Usage
2.10.3.1. Micrometer metrics support
If you wish to enable the collection of Micrometer metrics for the Reactor Netty transports, then you should declare a dependency on quarkus-micrometer
to ensure that they are available via the Quarkus metrics HTTP endpoint.
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-micrometer</artifactId> </dependency>
2.10.4. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.11. Azure Storage Queue Service
The azure-storage-queue component is used for storing and retrieving the messages to/from Azure Storage Queue using Azure SDK v12.
2.11.1. What’s inside
-
Azure Storage Queue Service component, URI syntax:
azure-storage-queue:accountName/queueName
Please refer to the above link for usage and configuration details.
2.11.2. Maven coordinates
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-azure-storage-queue</artifactId> </dependency>
2.11.3. Usage
2.11.3.1. Micrometer metrics support
If you wish to enable the collection of Micrometer metrics for the Reactor Netty transports, then you should declare a dependency on quarkus-micrometer
to ensure that they are available via the Quarkus metrics HTTP endpoint.
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-micrometer</artifactId> </dependency>
2.11.4. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.12. Bean Validator
Validate the message body using the Java Bean Validation API.
2.12.1. What’s inside
-
Bean Validator component, URI syntax:
bean-validator:label
Please refer to the above link for usage and configuration details.
2.12.2. Maven coordinates
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-bean-validator</artifactId> </dependency>
2.12.3. Usage
2.12.3.1. Configuring the ValidatorFactory
Implementation of this extension leverages the Quarkus Hibernate Validator extension.
Therefore it is not possible to configure the ValidatorFactory
by Camel’s properties (constraintValidatorFactory
, messageInterpolator
, traversableResolver
, validationProviderResolver
and validatorFactory
).
You can configure the ValidatorFactory
by the creation of beans which will be injected into the default ValidatorFactory
(created by Quarkus). See the Quarkus CDI documentation for more information.
2.12.3.2. Custom validation groups in native mode
When using custom validation groups in native mode, all the interfaces need to be registered for reflection (see the documentation).
Example:
@RegisterForReflection public interface OptionalChecks { }
2.12.4. Camel Quarkus limitations
It is not possible to describe your constraints as XML (by providing the file META-INF/validation.xml), only Java annotations are supported. This is caused by the limitation of the Quarkus Hibernate Validator extension (see the issue).
2.13. Bean
Invoke methods of Java beans
2.13.1. What’s inside
-
Bean component, URI syntax:
bean:beanName
- Bean Method language
-
Class component, URI syntax:
class:beanName
Please refer to the above links for usage and configuration details.
2.13.2. Maven coordinates
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-bean</artifactId> </dependency>
2.13.3. Usage
Except for invoking methods of beans available in Camel registry, Bean component and Bean method language can also invoke Quarkus CDI beans.
2.14. Bindy
Marshal and unmarshal between POJOs on one side and Comma separated values (CSV), fixed field length or key-value pair (KVP) formats on the other side using Camel Bindy
2.14.1. What’s inside
Please refer to the above links for usage and configuration details.
2.14.2. Maven coordinates
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-bindy</artifactId> </dependency>
2.14.3. Camel Quarkus limitations
When using camel-quarkus-bindy in native mode, only the build machine’s locale is supported.
For instance, on build machines with french locale, the code below:
BindyDataFormat dataFormat = new BindyDataFormat(); dataFormat.setLocale("ar");
formats numbers the arabic way in JVM mode as expected. However, it formats numbers the french way in native mode.
Without further tuning, the build machine’s default locale would be used. Another locale could be specified with the quarkus.native.user-language and quarkus.native.user-country configuration properties.
2.15. Cassandra CQL
Integrate with Cassandra 2.0 using the CQL3 API (not the Thrift API). Based on Cassandra Java Driver provided by DataStax.
2.15.1. What’s inside
-
Cassandra CQL component, URI syntax:
cql:beanRef:hosts:port/keyspace
Please refer to the above link for usage and configuration details.
2.15.2. Maven coordinates
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-cassandraql</artifactId> </dependency>
2.15.3. Additional Camel Quarkus configuration
2.15.3.1. Cassandra aggregation repository in native mode
In order to use Cassandra aggregation repositories like CassandraAggregationRepository
in native mode, you must enable native serialization support.
In addition, if your exchange bodies are custom types, then they must be registered for serialization by annotating their class declaration with @RegisterForReflection(serialization = true)
.
2.16. Core
Camel core functionality and basic Camel languages/ Constant, ExchangeProperty, Header, Ref, Simple and Tokenize
2.16.1. What’s inside
Please refer to the above links for usage and configuration details.
2.16.2. Maven coordinates
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>
2.16.3. Additional Camel Quarkus configuration
2.16.3.1. Simple language
2.16.3.1.1. Using the OGNL notation
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}") ---
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.
2.16.3.1.2. Using dynamic type resolution in native mode
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'") ---
As such, the class java.nio.ByteBuffer
needs to be registered for reflection.
2.16.3.1.3. Using the simple language with classpath resources in native mode
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");
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
2.16.3.1.4. Configuring a custom bean via properties in native mode
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 ---
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 |
|
|
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.
2.17. Cron
A generic interface for triggering events at times specified through the Unix cron syntax.
2.17.1. What’s inside
-
Cron component, URI syntax:
cron:name
Please refer to the above link for usage and configuration details.
2.17.2. Maven coordinates
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-cron</artifactId> </dependency>
2.17.3. Additional Camel Quarkus configuration
The cron component is a generic interface component, as such Camel Quarkus users will need to use the cron extension together with another extension offering an implementation.
For instance, one can use the Quartz Extension and cron extension together in its project.
2.18. Direct
Call another endpoint from the same Camel Context synchronously.
2.18.1. What’s inside
-
Direct component, URI syntax:
direct:name
Please refer to the above link for usage and configuration details.
2.18.2. Maven coordinates
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-direct</artifactId> </dependency>
2.19. FHIR
Exchange information in the healthcare domain using the FHIR (Fast Healthcare Interoperability Resources) standard. Marshall and unmarshall FHIR objects to/from JSON. Marshall and unmarshall FHIR objects to/from XML.
2.19.1. What’s inside
-
FHIR component, URI syntax:
fhir:apiName/methodName
- FHIR JSon data format
- FHIR XML data format
Please refer to the above links for usage and configuration details.
2.19.2. Maven coordinates
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-fhir</artifactId> </dependency>
2.19.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.19.4. Additional Camel Quarkus configuration
By default, only FHIR versions R4
& DSTU3
are enabled in native mode, since they are the default values on the FHIR component and DataFormat.
Configuration property | Type | Default |
---|---|---|
Enable FHIR DSTU2 Specs in native mode. |
|
|
Enable FHIR DSTU2_HL7ORG Specs in native mode. |
|
|
Enable FHIR DSTU2_1 Specs in native mode. |
|
|
Enable FHIR DSTU3 Specs in native mode. |
|
|
Enable FHIR R4 Specs in native mode. |
|
|
Enable FHIR R5 Specs in native mode. |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.20. File
Read and write files.
2.20.1. What’s inside
-
File component, URI syntax:
file:directoryName
Please refer to the above link for usage and configuration details.
2.20.2. Maven coordinates
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-file</artifactId> </dependency>
2.21. FTP
Upload and download files to/from SFTP, FTP or SFTP servers
2.21.1. What’s inside
-
FTP component, URI syntax:
ftp:host:port/directoryName
-
FTPS component, URI syntax:
ftps:host:port/directoryName
-
SFTP component, URI syntax:
sftp:host:port/directoryName
Please refer to the above links for usage and configuration details.
2.21.2. Maven coordinates
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-ftp</artifactId> </dependency>
2.22. Gson
Marshal POJOs to JSON and back using Gson
2.22.1. What’s inside
Please refer to the above link for usage and configuration details.
2.22.2. Maven coordinates
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-gson</artifactId> </dependency>
2.22.3. Additional Camel Quarkus configuration
2.22.3.1. Marshaling/Unmarshaling objects in native mode
When marshaling/unmarshaling objects in native mode, all the serialized classes need to be registered for reflection. As such, when using GsonDataFormat.setUnmarshalType(…)
, GsonDataFormat.setUnmarshalTypeName(…)
and even GsonDataFormat.setUnmarshalGenericType(…)
, the unmarshal type as well as sub field types should be registered for reflection. See a working example in this integration test.
2.23. HL7
Marshal and unmarshal HL7 (Health Care) model objects using the HL7 MLLP codec.
2.23.1. What’s inside
Please refer to the above links for usage and configuration details.
2.23.2. Maven coordinates
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-hl7</artifactId> </dependency>
2.23.3. Camel Quarkus limitations
For MLLP with TCP, Netty is the only supported means of running an Hl7 MLLP listener. Mina is not supported since it has no GraalVM native support at present.
Optional support for HL7MLLPNettyEncoderFactory
& HL7MLLPNettyDecoderFactory
codecs can be obtained by adding a dependency in your project pom.xml
to camel-quarkus-netty
.
2.24. HTTP
Send requests to external HTTP servers using Apache HTTP Client 4.x.
2.24.1. What’s inside
-
HTTP component, URI syntax:
http://httpUri
-
HTTPS (Secure) component, URI syntax:
https://httpUri
Please refer to the above links for usage and configuration details.
2.24.2. Maven coordinates
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-http</artifactId> </dependency>
2.24.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.24.4. transferException option in native mode
To use the transferException
option in native mode, you must enable support for object serialization. For more information, refer to the Registering Classes for Serialization section in the Developing Applications with Camel Extensions for Quarkus guide.
You will also need to enable serialization for the exception classes that you intend to serialize. For example.
@RegisterForReflection(targets = { IllegalStateException.class, MyCustomException.class }, serialization = true)
2.24.5. Additional Camel Quarkus configuration
your application to send or receive requests using non-default encodings.
2.25. Infinispan
Read and write from/to Infinispan distributed key/value store and data grid.
2.25.1. What’s inside
-
Infinispan component, URI syntax:
infinispan:cacheName
Please refer to the above link for usage and configuration details.
2.25.2. Maven coordinates
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-infinispan</artifactId> </dependency>
2.25.3. Camel Quarkus limitations
2.25.3.1. InfinispanRemoteAggregationRepository is unsupported
At present the InfinispanRemoteAggregationRepository
is not supported. The are some planned future enhancements to make this possible.
2.25.4. Additional Camel Quarkus configuration
You can either configure the Infinispan client via the relevant Camel Infinispan component & endpoint options, or you may use the Quarkus Infinispan extension configuration properties.
2.26. Jackson
Marshal POJOs to JSON and back using Jackson
2.26.1. What’s inside
Please refer to the above link for usage and configuration details.
2.26.2. Maven coordinates
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-jackson</artifactId> </dependency>
2.27. JacksonXML
Unmarshal a XML payloads to POJOs and back using XMLMapper extension of Jackson.
2.27.1. What’s inside
Please refer to the above link for usage and configuration details.
2.27.2. Maven coordinates
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-jacksonxml</artifactId> </dependency>
2.28. Jira
Interact with JIRA issue tracker.
2.28.1. What’s inside
-
Jira component, URI syntax:
jira:type
Please refer to the above link for usage and configuration details.
2.28.2. Maven coordinates
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-jira</artifactId> </dependency>
Applications using the camel-quarkus-jira
extension require an additional Maven repository https://packages.atlassian.com/maven-external/ to be configured either in the Maven settings.xml
file or in the pom.xml
file of the application project.
2.28.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.29. JMS
Sent and receive messages to/from a JMS Queue or Topic.
2.29.1. What’s inside
-
JMS component, URI syntax:
jms:destinationType:destinationName
Please refer to the above link for usage and configuration details.
2.29.2. Maven coordinates
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-jms</artifactId> </dependency>
2.29.3. Usage
2.29.3.1. Message mapping with org.w3c.dom.Node
The Camel JMS component supports message mapping between javax.jms.Message
and org.apache.camel.Message
. When wanting to convert a Camel message body type of org.w3c.dom.Node
, you must ensure that the camel-quarkus-jaxp
extension is present on the classpath.
2.29.3.2. Native mode support for javax.jms.ObjectMessage
When sending JMS message payloads as javax.jms.ObjectMessage
, you must annotate the relevant classes to be registered for serialization with @RegisterForReflection(serialization = true)
. Note that this extension automatically sets quarkus.camel.native.reflection.serialization-enabled = true
for you.
For more information, refer to the Registering Classes for Serialization section in the Developing Applications with Camel Extensions for Quarkus guide.
2.29.4. transferException option in native mode
To use the transferException
option in native mode, you must enable support for object serialization. For more information, refer to the Registering Classes for Serialization section in the Developing Applications with Camel Extensions for Quarkus guide.
You will also need to enable serialization for the exception classes that you intend to serialize. For example.
@RegisterForReflection(targets = { IllegalStateException.class, MyCustomException.class }, serialization = true)
2.30. JSON Path
Evaluate a JSONPath expression against a JSON message body
2.30.1. What’s inside
Please refer to the above link for usage and configuration details.
2.30.2. Maven coordinates
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-jsonpath</artifactId> </dependency>
2.31. JTA
Enclose Camel routes in transactions using Java Transaction API (JTA) and Narayana transaction manager
2.31.1. What’s inside
Please refer to the above link for usage and configuration details.
2.31.2. Maven coordinates
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-jta</artifactId> </dependency>
2.31.3. Usage
This extension should be added when you need to use the transacted()
EIP in the router. It leverages the transaction capabilities provided by the narayana-jta extension in Quarkus.
Refer to the Quarkus Transaction guide for the more details about transaction support. For a simple usage:
from("direct:transaction") .transacted() .to("sql:INSERT INTO A TABLE ...?dataSource=ds1") .to("sql:INSERT INTO A TABLE ...?dataSource=ds2") .log("all data are in the ds1 and ds2")
Support is provided for various transaction policies.
Policy | Description |
---|---|
| Support a current transaction; throw an exception if no current transaction exists. |
| Do not support a current transaction; throw an exception if a current transaction exists. |
| Do not support a current transaction; rather always execute non-transactionally. |
| Support a current transaction; create a new one if none exists. |
| Create a new transaction, suspending the current transaction if one exists. |
| Support a current transaction; execute non-transactionally if none exists. |
2.32. Kafka
Sent and receive messages to/from an Apache Kafka broker.
2.32.1. What’s inside
-
Kafka component, URI syntax:
kafka:topic
Please refer to the above link for usage and configuration details.
2.32.2. Maven coordinates
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-kafka</artifactId> </dependency>
2.32.3. Usage
2.32.3.1. Quarkus Kafka Dev Services
Camel Quarkus Kafka can take advantage of Quarkus Kafka Dev services to simplify development and testing with a local containerized Kafka broker.
Kafka Dev Services is enabled by default in dev & test mode. The Camel Kafka component is automatically configured so that the brokers
component option is set to point at the local containerized Kafka broker. Meaning that there’s no need to configure this option yourself.
This functionality can be disabled with the configuration property quarkus.kafka.devservices.enabled=false
.
2.32.4. Additional Camel Quarkus configuration
Configuration property | Type | Default |
---|---|---|
If |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.33. Kamelet
Materialize route templates
2.33.1. What’s inside
-
Kamelet component, URI syntax:
kamelet:templateId/routeId
Please refer to the above link for usage and configuration details.
2.33.2. Maven coordinates
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-kamelet</artifactId> </dependency>
2.33.3. Usage
2.33.3.1. Pre-load Kamelets at build-time
This extension allows to pre-load a set of Kamelets at build time using the quarkus.camel.kamelet.identifiers
property.
2.33.3.2. Using the Kamelet Catalog
A set of pre-made Kamelets can be found on the /camel-kamelets/latest[Kamelet Catalog]. To use the Kamelet from the catalog you need to copy their yaml definition (that you can find in the camel-kamelet repo) on your project in the classpath. Alternatively you can add the camel-kamelets-catalog
artifact to your pom.xml
:
<dependency> <groupId>org.apache.camel.kamelets</groupId> <artifactId>camel-kamelets-catalog</artifactId> </dependency>
This artifact add all the kamelets available in the catalog to your Camel Quarkus application for build time processing. If you include it with the scope provided
the artifact should not be part of the runtime classpath, but at build time, all the kamelets listed via quarkus.camel.kamelet.identifiers
property should be preloaded.
2.33.4. Additional Camel Quarkus configuration
Configuration property | Type | Default |
---|---|---|
List of kamelets identifiers to pre-load at build time. Each individual identifier is used to set the related |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.34. Log
Log messages to the underlying logging mechanism.
2.34.1. What’s inside
-
Log component, URI syntax:
log:loggerName
Please refer to the above link for usage and configuration details.
2.34.2. Maven coordinates
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-log</artifactId> </dependency>
2.35. Mail
Send and receive emails using imap, pop3 and smtp protocols. Marshal Camel messages with attachments into MIME-Multipart messages and back.
2.35.1. What’s inside
-
IMAP component, URI syntax:
imap:host:port
-
IMAPS (Secure) component, URI syntax:
imaps:host:port
- MIME Multipart data format
-
POP3 component, URI syntax:
pop3:host:port
-
POP3S component, URI syntax:
pop3s:host:port
-
SMTP component, URI syntax:
smtp:host:port
-
SMTPS component, URI syntax:
smtps:host:port
Please refer to the above links for usage and configuration details.
2.35.2. Maven coordinates
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-mail</artifactId> </dependency>
2.36. Microprofile Fault Tolerance
Circuit Breaker EIP using Microprofile Fault Tolerance
2.36.1. What’s inside
Please refer to the above link for usage and configuration details.
2.36.2. Maven coordinates
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-microprofile-fault-tolerance</artifactId> </dependency>
2.37. MicroProfile Health
Expose Camel health checks via MicroProfile Health
2.37.1. What’s inside
Please refer to the above link for usage and configuration details.
2.37.2. Maven coordinates
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-microprofile-health</artifactId> </dependency>
2.37.3. Usage
By default, classes extending AbstractHealthCheck
are registered as both liveness and readiness checks. You can override the isReadiness
method to control this behaviour.
Any checks provided by your application are automatically discovered and bound to the Camel registry. They will be available via the Quarkus health endpoints /q/health/live
and /q/health/ready
.
You can also provide custom HealthCheckRepository
implementations and these are also automatically discovered and bound to the Camel registry for you.
Refer to the Quarkus health guide for further information.
2.37.3.1. Provided health checks
Some checks are automatically registered for your application.
2.37.3.1.1. Camel Context Health
Inspects the Camel Context status and causes the health check status to be DOWN
if the status is anything other than 'Started'.
2.37.3.1.2. Camel Route Health
Inspects the status of each route and causes the health check status to be DOWN
if any route status is not 'Started'.
2.37.4. Additional Camel Quarkus configuration
Configuration property | Type | Default |
---|---|---|
Set whether to enable Camel health checks |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.38. MicroProfile Metrics
Expose metrics from Camel routes.
2.38.1. What’s inside
-
MicroProfile Metrics component, URI syntax:
microprofile-metrics:metricType:metricName
Please refer to the above link for usage and configuration details.
2.38.2. Maven coordinates
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-microprofile-metrics</artifactId> </dependency>
2.38.3. Usage
The microprofile-metrics component automatically exposes a set of Camel application metrics. Some of these include:
2.38.3.1. Camel Context metrics
Metric Name | Type |
---|---|
The status of the Camel Context represented by the | Gauge |
The Camel Context uptime in milliseconds | Gauge |
The total number of completed exchanges | Counter |
The total number of failed exchanges | Counter |
The total number of inflight exchanges | Gauge |
The total number of all exchanges | Counter |
The total number of all external redeliveries | Counter |
The total number of all failures handled | Counter |
2.38.3.2. Camel Route metrics
Metric Name | Type |
---|---|
The number of routes | Gauge |
The number of running routes | Gauge |
The total number of completed exchanges for the route | Counter |
The total number of failed exchanges for the route | Counter |
The total number of inflight exchanges for the route | Gauge |
The total number of all exchanges for the route | Counter |
The total number of all external redeliveries for the route | Counter |
The total number of all failures handled for the route | Counter |
All metrics are tagged with the name of the Camel Context and the id of the route where applicable.
You can also produce your own customized metrics in your Camel routes. For more information, refer to the microprofile-metrics component documentation.
Metrics are exposed to Quarkus as application metrics and they can be browsed at http://localhost:8080/q/metrics/application.
2.38.4. Additional Camel Quarkus configuration
Configuration property | Type | Default |
---|---|---|
Set whether to enable the MicroProfileMetricsRoutePolicyFactory for capturing metrics on route processing times. |
|
|
Set whether to enable the MicroProfileMetricsMessageHistoryFactory for capturing metrics on individual route node processing times. Depending on the number of configured route nodes, there is the potential to create a large volume of metrics. Therefore, this option is disabled by default. |
|
|
Set whether to enable the MicroProfileMetricsExchangeEventNotifier for capturing metrics on exchange processing times. |
|
|
Set whether to enable the MicroProfileMetricsRouteEventNotifier for capturing metrics on the total number of routes and total number of routes running. |
|
|
Set whether to enable the MicroProfileMetricsCamelContextEventNotifier for capturing metrics about the CamelContext, such as status and uptime. |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.39. MLLP
Communicate with external systems using the MLLP protocol.
2.39.1. What’s inside
-
MLLP component, URI syntax:
mllp:hostname:port
Please refer to the above link for usage and configuration details.
2.39.2. Maven coordinates
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-mllp</artifactId> </dependency>
2.39.3. Additional Camel Quarkus configuration
2.40. Mock
Test routes and mediation rules using mocks.
2.40.1. What’s inside
-
Mock component, URI syntax:
mock:name
Please refer to the above link for usage and configuration details.
2.40.2. Maven coordinates
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-mock</artifactId> </dependency>
2.40.3. Usage
To use camel-mock capabilities in tests it is required to get access to MockEndpoint instances.
CDI injection could be used for accessing instances (see Quarkus documentation). You can inject camelContext into test using @Inject
annotation. Camel context can be then used for obtaining mock endpoints. See the following example:
import javax.inject.Inject; import org.apache.camel.CamelContext; import org.apache.camel.ProducerTemplate; import org.apache.camel.component.mock.MockEndpoint; import org.junit.jupiter.api.Test; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest public class MockJvmTest { @Inject CamelContext camelContext; @Inject ProducerTemplate producerTemplate; @Test public void test() throws InterruptedException { producerTemplate.sendBody("direct:start", "Hello World"); MockEndpoint mockEndpoint = camelContext.getEndpoint("mock:result", MockEndpoint.class); mockEndpoint.expectedBodiesReceived("Hello World"); mockEndpoint.assertIsSatisfied(); } }
Route used for the example test:
import javax.enterprise.context.ApplicationScoped; import org.apache.camel.builder.RouteBuilder; @ApplicationScoped public class MockRoute extends RouteBuilder { @Override public void configure() throws Exception { from("direct:start").to("mock:result"); } }
2.40.4. Camel Quarkus limitations
Injection of CDI beans (described in Usage) does not work in native mode.
In the native mode the test and the application under test are running in two different processes and it is not possible to share a mock bean between them (see Quarkus documentation).
2.41. MongoDB
Perform operations on MongoDB documents and collections.
2.41.1. What’s inside
-
MongoDB component, URI syntax:
mongodb:connectionBean
Please refer to the above link for usage and configuration details.
2.41.2. Maven coordinates
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-mongodb</artifactId> </dependency>
2.41.3. Additional Camel Quarkus configuration
The extension leverages the Quarkus MongoDB Client extension. The Mongo client can be configured via the Quarkus MongoDB Client configuration options.
The Camel Quarkus MongoDB extension automatically registers a MongoDB client bean named camelMongoClient
. This can be referenced in the mongodb endpoint URI connectionBean
path parameter. For example:
from("direct:start") .to("mongodb:camelMongoClient?database=myDb&collection=myCollection&operation=findAll")
If your application needs to work with multiple MongoDB servers, you can create a "named" client and reference in your route by injecting a client and the related configuration as explained in the Quarkus MongoDB extension client injection. For example:
//application.properties quarkus.mongodb.mongoClient1.connection-string = mongodb://root:example@localhost:27017/
//Routes.java @ApplicationScoped public class Routes extends RouteBuilder { @Inject @MongoClientName("mongoClient1") MongoClient mongoClient1; @Override public void configure() throws Exception { from("direct:defaultServer") .to("mongodb:camelMongoClient?database=myDb&collection=myCollection&operation=findAll") from("direct:otherServer") .to("mongodb:mongoClient1?database=myOtherDb&collection=myOtherCollection&operation=findAll"); } }
Note that when using named clients, the "default" camelMongoClient
bean will still be produced. Refer to the Quarkus documentation on Multiple MongoDB Clients for more information.
2.42. Netty
Socket level networking using TCP or UDP with Netty 4.x.
2.42.1. What’s inside
-
Netty component, URI syntax:
netty:protocol://host:port
Please refer to the above link for usage and configuration details.
2.42.2. Maven coordinates
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-netty</artifactId> </dependency>
2.43. OpenAPI Java
Expose OpenAPI resources defined in Camel REST DSL
2.43.1. What’s inside
Please refer to the above link for usage and configuration details.
2.43.2. Maven coordinates
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-openapi-java</artifactId> </dependency>
2.43.3. Camel Quarkus limitations
The apiContextIdListing
configuration option is not supported. Since multiple CamelContext`s are not supported and Quarkus applications run standalone, there is no scenario where attempting to resolve OpenApi specifications for a specific `CamelContext
would be useful. It also introduces some additional overhead of requiring JMX (which is not supported in native mode) & additional Camel Quarkus extensions for processing XML.
2.44. Paho
Communicate with MQTT message brokers using Eclipse Paho MQTT Client.
2.44.1. What’s inside
-
Paho component, URI syntax:
paho:topic
Please refer to the above link for usage and configuration details.
2.44.2. Maven coordinates
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-paho</artifactId> </dependency>
2.45. Paho MQTT5
Communicate with MQTT message brokers using Eclipse Paho MQTT v5 Client.
2.45.1. What’s inside
-
Paho MQTT 5 component, URI syntax:
paho-mqtt5:topic
Please refer to the above link for usage and configuration details.
2.45.2. Maven coordinates
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-paho-mqtt5</artifactId> </dependency>
2.46. Platform HTTP
This extension allows for creating HTTP endpoints for consuming HTTP requests.
It is built on top of the Eclipse Vert.x HTTP server provided by the quarkus-vertx-http
extension.
2.46.1. What’s inside
-
Platform HTTP component, URI syntax:
platform-http:path
Please refer to the above link for usage and configuration details.
2.46.2. Maven coordinates
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-platform-http</artifactId> </dependency>
2.46.3. Usage
2.46.3.1. Basic Usage
Serve all HTTP methods on the /hello
endpoint:
from("platform-http:/hello").setBody(simple("Hello ${header.name}"));
Serve only GET requests on the /hello
endpoint:
from("platform-http:/hello?httpMethodRestrict=GET").setBody(simple("Hello ${header.name}"));
2.46.3.2. Using platform-http
via Camel REST DSL
To be able to use Camel REST DSL with the platform-http
component, add camel-quarkus-rest
in addition to camel-quarkus-platform-http
to your pom.xml
:
<dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-rest</artifactId> </dependency>
Then you can use the Camel REST DSL:
rest() .get("/my-get-endpoint") .route() .setBody(constant("Hello from /my-get-endpoint")) .endRest() .post("/my-post-endpoint") .route() .setBody(constant("Hello from /my-post-endpoint")) .endRest();
2.46.3.3. Handling multipart/form-data
file uploads
You can restrict the uploads to certain file extensions by white listing them:
from("platform-http:/upload/multipart?fileNameExtWhitelist=html,txt&httpMethodRestrict=POST") .to("log:multipart") .process(e -> { final AttachmentMessage am = e.getMessage(AttachmentMessage.class); if (am.hasAttachments()) { am.getAttachments().forEach((fileName, dataHandler) -> { try (InputStream in = dataHandler.getInputStream()) { // do something with the input stream } catch (IOException ioe) { throw new RuntimeException(ioe); } }); } });
2.46.3.4. Securing platform-http
endpoints
Quarkus provides a variety of security and authentication mechanisms which can be used to secure platform-http
endpoints. Refer to the Quarkus Security documentation for further details.
Within a route, it is possible to obtain the authenticated user and its associated SecurityIdentity
and Principal
:
from("platform-http:/secure") .process(e -> { Message message = e.getMessage(); QuarkusHttpUser user = message.getHeader(VertxPlatformHttpConstants.AUTHENTICATED_USER, QuarkusHttpUser.class); SecurityIdentity securityIdentity = user.getSecurityIdentity(); Principal principal = securityIdentity.getPrincipal(); // Do something useful with SecurityIdentity / Principal. E.g check user roles etc. });
Also check the quarkus.http.body.*
configuration options in Quarkus documentation, esp. quarkus.http.body.handle-file-uploads
, quarkus.http.body.uploads-directory
and quarkus.http.body.delete-uploaded-files-on-end
.
2.46.4. Additional Camel Quarkus configuration
2.46.4.1. Platform HTTP server configuration
Configuration of the platform HTTP server is managed by Quarkus. Refer to the Quarkus HTTP configuration guide for the full list of configuration options.
To configure SSL for the Platform HTTP server, follow the secure connections with SSL guide. Note that configuring the server for SSL with SSLContextParameters
is not currently supported.
2.46.4.2. Character encodings
- Check the Character Encodings section of the Developing Applications with Camel Extensions for Quarkus guide if you expect your application to send or receive requests using non-default encodings.
2.47. Protobuf Jackson
Marshal POJOs to Protobuf and back using Jackson.
2.47.1. What’s inside
Please refer to the above link for usage and configuration details.
2.47.2. Maven coordinates
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-jackson-protobuf</artifactId> </dependency>
2.48. Quartz
Schedule sending of messages using the Quartz 2.x scheduler.
2.48.1. What’s inside
-
Quartz component, URI syntax:
quartz:groupName/triggerName
Please refer to the above link for usage and configuration details.
2.48.2. Maven coordinates
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-quartz</artifactId> </dependency>
2.49. Rest
Expose REST services and their OpenAPI Specification or call external REST services.
2.49.1. What’s inside
-
REST component, URI syntax:
rest:method:path:uriTemplate
-
REST API component, URI syntax:
rest-api:path
Please refer to the above links for usage and configuration details.
2.49.2. Maven coordinates
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-rest</artifactId> </dependency>
2.49.3. Additional Camel Quarkus configuration
This extension depends on the Platform HTTP extension and configures it as the component that provides the REST transport.
2.49.3.1. Path parameters containing special characters with platform-http
When using the platform-http
REST transport, some characters are not allowed within path parameter names. This includes the '-' and '$' characters.
In order to make the below example REST /dashed/param
route work correctly, a system property is required io.vertx.web.route.param.extended-pattern=true
.
import org.apache.camel.builder.RouteBuilder; public class CamelRoute extends RouteBuilder { @Override public void configure() { rest("/api") // Dash '-' is not allowed by default .get("/dashed/param/{my-param}") .route() .setBody(constant("Hello World")) .endRest() // The non-dashed path parameter works by default .get("/undashed/param/{myParam}") .route() .setBody(constant("Hello World")) .endRest(); } }
There is some more background to this in the Vert.x Web documentation.
2.49.3.2. Configuring alternate REST transport providers
To use another REST transport provider, such as netty-http
or servlet
, you need to add the respective extension as a dependency to your project and set the provider in your RouteBuilder
. E.g. for servlet
, you’d have to add the org.apache.camel.quarkus:camel-quarkus-servlet
dependency and the set the provider as follows:
import org.apache.camel.builder.RouteBuilder; public class CamelRoute extends RouteBuilder { @Override public void configure() { restConfiguration() .component("servlet"); ... } }
2.50. Salesforce
Communicate with Salesforce using Java DTOs.
2.50.1. What’s inside
-
Salesforce component, URI syntax:
salesforce:operationName:topicName
Please refer to the above link for usage and configuration details.
2.50.2. Maven coordinates
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-salesforce</artifactId> </dependency>
2.50.3. Usage
2.50.3.1. Generating Salesforce DTOs with the salesforce-maven-plugin
The camel-salesforce-maven-plugin
is only covered by community support.
To generate Salesforce DTOs for your project, use the salesforce-maven-plugin
. The example code snippet below creates a single DTO for the Account
object.
<plugin> <groupId>org.apache.camel.maven</groupId> <artifactId>camel-salesforce-maven-plugin</artifactId> <version>3.14.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <clientId>${env.SALESFORCE_CLIENTID}</clientId> <clientSecret>${env.SALESFORCE_CLIENTSECRET}</clientSecret> <userName>${env.SALESFORCE_USERNAME}</userName> <password>${env.SALESFORCE_PASSWORD}</password> <loginUrl>https://login.salesforce.com</loginUrl> <packageName>org.apache.camel.quarkus.component.salesforce.generated</packageName> <outputDirectory>src/main/java</outputDirectory> <includes> <include>Account</include> </includes> </configuration> </execution> </executions> </plugin>
2.50.4. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.51. SEDA
Asynchronously call another endpoint from any Camel Context in the same JVM.
2.51.1. What’s inside
-
SEDA component, URI syntax:
seda:name
Please refer to the above link for usage and configuration details.
2.51.2. Maven coordinates
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-seda</artifactId> </dependency>
2.52. Slack
Send and receive messages to/from Slack.
2.52.1. What’s inside
-
Slack component, URI syntax:
slack:channel
Please refer to the above link for usage and configuration details.
2.52.2. Maven coordinates
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-slack</artifactId> </dependency>
2.52.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.53. SOAP dataformat
Marshal Java objects to SOAP messages and back.
2.53.1. What’s inside
Please refer to the above link for usage and configuration details.
2.53.2. Maven coordinates
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-soap</artifactId> </dependency>
2.54. SQL
Perform SQL queries.
2.54.1. What’s inside
-
SQL component, URI syntax:
sql:query
-
SQL Stored Procedure component, URI syntax:
sql-stored:template
Please refer to the above links for usage and configuration details.
2.54.2. Maven coordinates
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-sql</artifactId> </dependency>
2.54.3. Camel Quarkus limitations
Oracle JDBC driver brings some GraalVM native-image configuration that breaks the serialization support in Camel Quarkus and Quarkus in general. See this quarkus issue for more details.
Aggregation repository does not work in native mode with Oracle db, because of this issue.
2.54.4. Additional Camel Quarkus configuration
2.54.4.1. Configuring a DataSource
This extension leverages Quarkus Agroal for DataSource
support. Setting up a DataSource
can be achieved via configuration properties.
quarkus.datasource.db-kind=postgresql quarkus.datasource.username=your-username quarkus.datasource.password=your-password quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/your-database quarkus.datasource.jdbc.max-size=16
The Camel SQL component will automatically resolve the DataSource
bean from the registry. When configuring multiple datasources, you can specify which one is to be used on an SQL endpoint via the URI options datasource
or dataSourceRef
. Refer to the SQL component documentation for more details.
2.54.4.1.1. Zero configuration with Quarkus Dev Services
In dev and test mode you can take advantage of Configuration Free Databases. The Camel SQL component will be automatically configured to use a DataSource
that points to a local containerized instance of the database matching the JDBC driver type that you have selected.
2.54.4.2. SQL scripts
When configuring sql
or sql-stored
endpoints to reference script files from the classpath, set the following configuration property to ensure that they are available in native mode.
quarkus.native.resources.includes = queries.sql, sql/*.sql
2.54.4.3. SQL aggregation repository in native mode
In order to use SQL aggregation repositories like JdbcAggregationRepository
in native mode, you must enable native serialization support.
In addition, if your exchange bodies are custom types, they must be registered for serialization by annotating their class declaration with @RegisterForReflection(serialization = true)
.
2.55. Telegram
Send and receive messages acting as a Telegram Bot Telegram Bot API.
2.55.1. What’s inside
-
Telegram component, URI syntax:
telegram:type
Please refer to the above link for usage and configuration details.
2.55.2. Maven coordinates
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-telegram</artifactId> </dependency>
2.55.3. SSL in native mode
This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true
to your application.properties
yourself. See also Quarkus SSL guide.
2.56. Timer
Generate messages in specified intervals using java.util.Timer.
2.56.1. What’s inside
-
Timer component, URI syntax:
timer:timerName
Please refer to the above link for usage and configuration details.
2.56.2. Maven coordinates
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-timer</artifactId> </dependency>
2.57. XPath
Evaluates an XPath expression against an XML payload.
2.57.1. What’s inside
Please refer to the above link for usage and configuration details.
2.57.2. Maven coordinates
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-xpath</artifactId> </dependency>
2.57.3. Additional Camel Quarkus configuration
This component is able to load xpath expressions from classpath resources. To make it work also in native mode, you need to explicitly embed the expression files in the native executable by using the quarkus.native.resources.includes
property.
For instance, the route below would load an XPath expression from a classpath resource named myxpath.txt
:
from("direct:start").transform().xpath("resource:classpath:myxpath.txt");
To include this (an possibly other expressions stored in .txt
files) in the native image, you would have to add something like the following to your application.properties
file:
quarkus.native.resources.includes = *.txt
2.58. XQuery
Query and/or transform XML payloads using XQuery and Saxon.
2.58.1. What’s inside
-
XQuery component, URI syntax:
xquery:resourceUri
- XQuery language
Please refer to the above links for usage and configuration details.
2.58.2. Maven coordinates
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-saxon</artifactId> </dependency>
2.58.3. Additional Camel Quarkus configuration
This component is able to load XQuery definitions from classpath. To make it work also in native mode, you need to explicitly embed the queries in the native executable by using the quarkus.native.resources.includes
property.
For instance, the two routes below load an XQuery script from two classpath resources named myxquery.txt
and another-xquery.txt
respectively:
from("direct:start").transform().xquery("resource:classpath:myxquery.txt", String.class); from("direct:start").to("xquery:another-xquery.txt");
To include these (an possibly other queries stored in .txt
files) in the native image, you would have to add something like the following to your application.properties
file:
quarkus.native.resources.includes = *.txt
2.59. Zip File
Compression and decompress streams using java.util.zip.ZipStream.
2.59.1. What’s inside
Please refer to the above link for usage and configuration details.
2.59.2. Maven coordinates
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-zipfile</artifactId> </dependency>