Red Hat build of Apache Camel for Quarkus Reference
Red Hat build of Apache Camel for Quarkus provided by Red Hat
Abstract
Preface Copy linkLink copied to clipboard!
Providing feedback on Red Hat build of Apache Camel documentation
To report an error or to improve our documentation, log in to your Red Hat Jira account and submit an issue. If you do not have a Red Hat Jira account, then you will be prompted to create an account.
Procedure
- Click the following link to create ticket
- Enter a brief description of the issue in the Summary.
- Provide a detailed description of the issue or enhancement in the Description. Include a URL to where the issue occurs in the documentation.
- Clicking Submit creates and routes the issue to the appropriate documentation team.
Chapter 1. Camel Quarkus extensions overview Copy linkLink copied to clipboard!
1.1. Support level definitions Copy linkLink copied to clipboard!
New features, services, and components go through a number of support levels before inclusion in Red Hat build of Apache Camel for Quarkus as fully supported for production use. This is to ensure the right balance between providing the enterprise stability expected of our offerings with the need to allow our customers and partners to experiment with new Red Hat build of Apache Camel for Quarkus technologies while providing feedback to help guide future development activities.
| Type | Description |
|---|---|
| Community Support | As part of Red Hat’s commitment to upstream first, integration of new extensions into our Red Hat build of Apache Camel for Quarkus distribution begins in the upstream community. While these extensions have been tested and documented upstream, we have not reviewed the maturity of these extensions and they may not be formally supported by Red Hat in future product releases. Note Community extensions are listed on the extensions reference page of the Camel Quarkus community project. |
| Technology Preview | Technology Preview features provide early access to upcoming product innovations, enabling you to test functionality and provide feedback during the development process. However, these features are not fully supported under Red Hat Subscription Level Agreements, may not be functionally complete, and are not intended for production use. As Red Hat considers making future iterations of Technology Preview features generally available, we will attempt to resolve any issues that customers experience when using these features. |
| Production Support | Production Support extensions are shipped in a formal Red Hat release and are fully supported. There are no documentation gaps and extensions have been tested on all supported configurations. |
1.2. Supported extensions Copy linkLink copied to clipboard!
There are 110 extensions.
| Extension | Artifact | Description | JVM Support Level | Native Support Level | Support on IBM Power and IBM Z | |
|---|---|---|---|---|---|---|
| 1 | AMQP | Messaging with AMQP protocol using Apache QPid Client. | Production Support | Production Support | Yes | |
| 2 | Attachments | Support for attachments on Camel messages | Production Support | Production Support | Yes | |
| 3 | AWS Secrets Manager | Manage AWS Secrets Manager services using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 4 | AWS2 CloudWatch | Sending metrics to AWS CloudWatch using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 5 | AWS2 DynamoDB | Store and retrieve data from AWS DynamoDB service or receive messages from AWS DynamoDB Stream using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 6 | AWS2 Kinesis | Consume and produce records from AWS Kinesis Streams using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 7 | AWS2 Lambda | Manage and invoke AWS Lambda functions using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 8 | AWS2 S3 Storage | Store and retrieve objects from AWS S3 Storage Service using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 9 | AWS2 Simple Notification System (SNS) | Send messages to an AWS Simple Notification Topic using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 10 | AWS2 Simple Queue Service (SQS) | Send and receive messages to/from AWS SQS service using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 11 | Azure Key Vault | Manage secrets and keys in Azure Key Vault Service | Production Support | Production Support | Yes | |
| 12 | Azure ServiceBus | Send and receive messages to/from Azure Service Bus. | Technology Preview | Technology Preview | Yes | |
| 13 | Azure Storage Blob | Store and retrieve blobs from Azure Storage Blob Service using SDK v12. | Production Support | Production Support | Yes | |
| 14 | Azure Storage Queue |
The | Production Support | Production Support | Yes | |
| 15 | Bean | Invoke methods of Java beans | Production Support | Production Support | Yes | |
| 16 | BeanIO | Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats). | Production Support | Not supported | Yes | |
| 17 | Bean-validator | Validate the message body using the Java Bean Validation API. | Production Support | Production Support | Yes | |
| 18 | Browse | Inspect the messages received on endpoints supporting BrowsableEndpoint. | Production Support | Production Support | Yes | |
| 19 | Cassandra CQL | Integrate with Cassandra 2.0 using the CQL3 API (not the Thrift API). Based on Cassandra Java Driver provided by DataStax. | Production Support | Production Support | Yes | |
| 20 | Cli-connector | Runtime adapter connecting with Camel CLI | Production Support | Production Support | Yes | |
| 21 | Controlbus | Manage and monitor Camel routes. | Production Support | Production Support | Yes | |
| 22 | Core | Camel core functionality and basic Camel languages/ Constant, ExchangeProperty, Header, Ref, Simple and Tokenize | Production Support | Production Support | Yes | |
| 23 | Crypto | Sign and verify exchanges using the Signature Service of the Java Cryptographic Extension (JCE). | Production Support | Production Support | Yes | |
| 24 | Cron | A generic interface for triggering events at times specified through the Unix cron syntax. | Production Support | Production Support | Yes | |
| 25 | CXF SOAP | Expose SOAP WebServices using Apache CXF or connect to external WebServices using CXF WS client. | Production Support | Production Support | Yes | |
| 26 | Dataformat | Use a Camel Data Format as a regular Camel Component. | Production Support | Production Support | Yes | |
| 27 | Dataset | Provide data for load and soak testing of your Camel application. | Technology Preview | Technology Preview | Yes | |
| 28 | Direct | Call another endpoint from the same Camel Context synchronously. | Production Support | Production Support | Yes | |
| 29 | Elasticsearch Low level Rest Client | Perform queries and other operations on Elasticsearch or OpenSearch (uses low-level client). | Production Support | Production Support | Yes | |
| 30 | 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. | Production Support | Production Support | No | |
| 31 | Flink | Send DataSet jobs to an Apache Flink cluster. | Technology Preview | None | Yes | |
| 32 | File | Read and write files. | Production Support | Production Support | Yes | |
| 33 | File cluster service | Provides a FileLock implementation of the Camel Cluster Service SPI | Production Support | Production Support | Yes | |
| 34 | FTP | Upload and download files to/from SFTP, FTP or SFTP servers | Production Support | Production Support | Yes | |
| 35 | Google BigQuery | Access Google Cloud BigQuery service using SQL queries or Google Client Services API | Production Support | Production Support | Yes | |
| 36 | Google Pubsub | Send and receive messages to/from Google Cloud Platform PubSub Service. | Production Support | Production Support | Yes | |
| 37 | Google Secret Manager | Manage Google Secret Manager Secrets | Production Support | Production Support | Yes | |
| 38 | GraphQL | Send GraphQL queries and mutations to external systems. | Production Support | Production Support | Yes | |
| 39 | gRPC | Expose gRPC endpoints and access external gRPC endpoints. | Production Support | Production Support | Yes | |
| 40 | Hashicorp Vault | Manage secrets in Hashicorp Vault Service | Production Support | Production Support | Yes | |
| 41 | HTTP | Send requests to external HTTP servers using Apache HTTP Client 5.x. | Production Support | Production Support | Yes | |
| 42 | Infinispan | Read and write from/to Infinispan distributed key/value store and data grid. | Production Support | Production Support | No | |
| 43 | Jasypt | Security using Jasypt | Production Support | Production Support | Yes | |
| 44 | Java JOOR DSL | Support for parsing Java route definitions at runtime | Community Support | Community Support | Yes | |
| 45 | JDBC | Access databases through SQL and JDBC. | Production Support | Production Support | Yes | |
| 46 | JIRA | Interact with JIRA issue tracker. | Production Support | Production Support | Yes | |
| 47 | JMS | Sent and receive messages to/from a JMS Queue or Topic. | Production Support | Production Support | Yes | |
| 48 | JPA | Store and retrieve Java objects from databases using Java Persistence API (JPA). | Production Support | Production Support | Yes | |
| 49 | JT400 | Exchanges messages with an IBM i system using data queues, message queues, or program call. IBM i is the replacement for AS/400 and iSeries servers. | Production Support | Production Support | Yes | |
| 50 | JTA | Enclose Camel routes in transactions using Java Transaction API (JTA) and Narayana transaction manager. | Production Support | Production Support | Yes | |
| 51 | Kafka | Sent and receive messages to/from an Apache Kafka broker. | Production Support | Production Support | Yes | |
| 52 | Kamelet | Materialize route templates | Production Support | Production Support | Yes | |
| 53 | Kubernetes | Perform operations against Kubernetes API | Technology Preview | Technology Preview | Yes | |
| 54 | Kubernetes Cluster Service | Provides a Kubernetes implementation of the Camel Cluster Service SPI | Production Support | Production Support | Yes | |
| 55 | Kudu | Interact with Apache Kudu, a free and open source column-oriented data store of the Apache Hadoop ecosystem. | Production Support | Production Support | No | |
| 56 | Language | Execute scripts in any of the languages supported by Camel. | Production Support | Production Support | Yes | |
| 57 | LDAP | Perform searches on LDAP servers. | Production Support | Production Support | Yes | |
| 58 | Log | Log messages to the underlying logging mechanism. | Production Support | Production Support | Yes | |
| 59 | LRA | Camel saga binding for Long-Running-Action framework. | Technology Preview | Technology Preview | Yes | |
| 60 | | Send and receive emails using imap, pop3 and smtp protocols. Marshal Camel messages with attachments into MIME-Multipart messages and back. | Production Support | Production Support | Yes | |
| 61 | Management | JMX management strategy and associated managed resources. | Production Support | Production Support | Yes | |
| 62 | MapStruct | Type Conversion using Mapstruct | Production Support | Production Support | Yes | |
| 63 | Master | Have only a single consumer in a cluster consuming from a given endpoint; with automatic failover if the JVM dies. | Production Support | Production Support | Yes | |
| 64 | Micrometer | Collect various metrics directly from Camel routes using the Micrometer library. | Production Support | Production Support | Yes | |
| 65 | MicroProfile Fault Tolerance | Circuit Breaker EIP using Microprofile Fault Tolerance | Production Support | Production Support | Yes | |
| 66 | MicroProfile Health | Expose Camel health checks via MicroProfile Health | Production Support | Production Support | Yes | |
| 67 | Minio | Store and retrieve objects from Minio Storage Service using Minio SDK. | Production Support | Production Support | Yes | |
| 68 | MLLP | Communicate with external systems using the MLLP protocol. | Production Support | Production Support | Yes | |
| 69 | MyBatis | Performs a query, poll, insert, update or delete in a relational database using MyBatis. | Production Support | Production Support | Yes | |
| 70 | Mock | Test routes and mediation rules using mocks. | Production Support | Production Support | Yes | |
| 71 | MongoDB | Perform operations on MongoDB documents and collections. | Technology Preview | Technology Preview | Yes | |
| 72 | Netty | Socket level networking using TCP or UDP with Netty 4.x. | Production Support | Production Support | Yes | |
| 73 | Netty HTTP | Netty HTTP server and client using the Netty 4.x. | Production Support | Production Support | Yes | |
| 74 | Openapi Java | Expose OpenAPI resources defined in Camel REST DSL | Production Support | Production Support | Yes | |
| 75 | OpenTelemetry | Distributed tracing using OpenTelemetry | Production Support | Production Support | Yes | |
| 76 | Qute | Transform messages using Quarkus Qute templating engine | Production Support | Production Support | Yes | |
| 77 | Quartz | Schedule sending of messages using the Quartz 2.x scheduler. | Production Support | Production Support | Yes | |
| 78 | Paho | Communicate with MQTT message brokers using Eclipse Paho MQTT Client. | Production Support | Production Support | Yes | |
| 79 | Paho MQTT5 | Communicate with MQTT message brokers using Eclipse Paho MQTT v5 Client. | Production Support | Production Support | Yes | |
| 80 | Platform HTTP | Expose HTTP endpoints using the HTTP server available in the current platform. | Production Support | Production Support | Yes | |
| 81 | Ref | Route messages to an endpoint looked up dynamically by name in the Camel Registry. | Production Support | Production Support | Yes | |
| 82 | REST | Expose REST services and their OpenAPI Specification or call external REST services. | Production Support | Production Support | Yes | |
| 83 | REST OpenAPI | Configure REST producers based on an OpenAPI specification document delegating to a component implementing the RestProducerFactory interface. | Production Support | Production Support | Yes | |
| 84 | Salesforce | Communicate with Salesforce using Java DTOs. | Production Support | Production Support | Yes | |
| 85 | SAGA | Execute custom actions within a route using the Saga EIP. | Technology Preview | Technology Preview | Yes | |
| 86 | SAP | Provides SAP Camel Component. | Production Support | None | Yes | |
| 87 | Saxon | Query and/or transform XML payloads using XQuery and Saxon. | Production Support | Production Support | Yes | |
| 88 | Scheduler | Generate messages in specified intervals using java.util.concurrent.ScheduledExecutorService. | Production Support | Production Support | Yes | |
| 89 | Seda | Asynchronously call another endpoint from any Camel Context in the same JVM. | Production Support | Production Support | Yes | |
| 90 | Servlet | Serve HTTP requests by a Servlet. | Production Support | Production Support | Yes | |
| 91 | Slack | Send and receive messages to/from Slack. | Production Support | Production Support | Yes | |
| 92 | SMB | SMB component which consumes natively from file shares using the Server Message Block (SMB, also known as Common Internet File System - CIFS) protocol | Production Support | Production Support | Yes | |
| 93 | SNMP | Receive traps and poll SNMP (Simple Network Management Protocol) capable devices. | Production Support | Technology Preview | Yes | |
| 94 | Splunk | Publish or search for events in Splunk. | Production Support | Production Support | Yes | |
| 95 | Splunk HEC | The splunk component allows to publish events in Splunk using the HTTP Event Collector. | Production Support | Production Support | Yes | |
| 96 | Spring RabbitMQ | Send and receive messages from RabbitMQ using Spring RabbitMQ client. | Production Support | Production Support | Yes | |
| 97 | SQL | Perform SQL queries. | Production Support | Production Support | Yes | |
| 98 | Telegram | Send and receive messages acting as a Telegram Bot Telegram Bot API. | Production Support | Production Support | Yes | |
| 99 | Timer | Generate messages in specified intervals using java.util.Timer. | Production Support | Production Support | Yes | |
| 100 | Validator | Validate the payload using XML Schema and JAXP Validation. | Production Support | Production Support | Yes | |
| 101 | Velocity | Transform messages using a Velocity template. | Production Support | Production Support | Yes | |
| 102 | VertX HTTP | Camel HTTP client support with Vert.x | Production Support | Production Support | Yes | |
| 103 | VertX Websocket | Camel WebSocket support with Vert.x | Production Support | Production Support | Yes | |
| 104 | XJ | Transform JSON and XML message using a XSLT | Production Support | Production Support | Yes | |
| 105 | XML IO DSL | An XML stack for parsing XML route definitions | Production Support | Production Support | Yes | |
| 106 | XSLT | Transforms XML payload using an XSLT template. | Production Support | Production Support | Yes | |
| 107 | XSLT Saxon | Transform XML payloads using an XSLT template using Saxon. | Production Support | Production Support | Yes | |
| 108 | Zip File | Compression and decompress streams using java.util.zip.ZipStream. | Production Support | Production Support | Yes | |
| 109 | Zip Deflate Compression | Compress and decompress streams using java.util.zip.Deflater, java.util.zip.Inflater or java.util.zip.GZIPStream. | Production Support | Production Support | Yes |
1.3. Supported languages Copy linkLink copied to clipboard!
There are 11 languages.
| Extension | Artifact | Description | JVM Support Level | Native Support Level | Support on IBM Power and IBM Z | |
|---|---|---|---|---|---|---|
| 1 | Bean | Invoke methods of Java beans. | Production Support | Production Support | Yes | |
| 2 | Core | Camel core functionality and basic Camel languages/ Constant, ExchangeProperty, Header, Ref, Simple and Tokenize. | Production Support | Production Support | Yes | |
| 3 | Hl7 | Marshal and unmarshal HL7 (Health Care) model objects using the HL7 MLLP codec. | Production Support | Production Support | Yes | |
| 4 | JSONPath | Evaluate a JSONPath expression against a JSON message body. | Production Support | Production Support | Yes | |
| 5 | Jslt | Query or transform JSON payloads using an JSLT. | Production Support | Production Support | Yes | |
| 110 | JQ | Evaluates a JQ expression against a JSON message body. | Production Support | Production Support | Yes | |
| 6 | Saxon | Query and/or transform XML payloads using XQuery and Saxon. | Production Support | Production Support | Yes | |
| 7 | XML IO DSL | An XML stack for parsing XML route definitions | Production Support | Production Support | Yes | |
| 8 | XML IO DSL | An XML stack for parsing XML route definitions | Production Support | Production Support | Yes | |
| 9 | Xpath | Evaluates an XPath expression against an XML payload. | Production Support | Production Support | Yes | |
| 10 | YAML DSL | A YAML stack for parsing YAML route definitions | Production Support | Production Support | Yes | |
| 11 | YAML DSL | A YAML stack for parsing YAML route definitions | Production Support | Production Support | Yes |
1.4. Supported data formats Copy linkLink copied to clipboard!
There are 14 data formats.
| Extension | Artifact | Description | JVM Support Level | Native Support Level | Support on IBM Power and IBM Z | |
|---|---|---|---|---|---|---|
| 1 | Avro | Serialize and deserialize messages using Apache Avro binary data format. | Production support | Production support | Yes | |
| 2 | BeanIO | Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats). | Production support | Not supported | Yes | |
| 3 | 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 | Production support | Production support | Yes | |
| 4 | Crypto | Java Cryptographic Extension: Symmetric (shared-key) encryption and decryption using Camel’s marshal and unmarshal formatting mechanism. | Production support | Production support | Yes | |
| 5 | Gson | Marshal POJOs to JSON and back using Gson | Production support | Production support | Yes | |
| 6 | Hl7 | Marshal and unmarshal HL7 (Health Care) model objects using the HL7 MLLP codec. | Production support | Production support | Yes | |
| 7 | Jackson | Marshal POJOs to JSON and back using Jackson | Production support | Production support | Yes | |
| 8 | Jackson Avro | Marshal POJOs to Avro and back using Jackson. | Production support | Production support | Yes | |
| 9 | Jackson ProtoBuf | Marshal POJOs to Protobuf and back using Jackson. | Production support | Production support | Yes | |
| 10 | Jackson XML | Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson. | Production support | Production support | Yes | |
| 11 | Jaxb | Unmarshal XML payloads to POJOs and back using JAXB2 XML marshalling standard. | Production support | Production support | Yes | |
| 12 | Xml-JAXP | Camel XML JAXP | Production support | Production support | Yes | |
| 13 | PGP | Symmetric (shared-key) encryption and decryption using Camel’s marshal and unmarshal formatting mechanism. | Production support | Production support | Yes | |
| 14 | SOAP | Marshal Java objects to SOAP messages and back. | Production support | Production support | Yes |
Chapter 2. Camel Quarkus extensions reference Copy linkLink copied to clipboard!
This chapter provides usage information for Red Hat build of Apache Camel for Quarkus.
2.1. AMQP Copy linkLink copied to clipboard!
Messaging with AMQP protocol using Apache QPid Client.
2.1.1. What’s inside Copy linkLink copied to clipboard!
-
AMQP component, URI syntax:
amqp:destinationType:destinationName
Refer to the above link for usage and configuration details.
2.1.2. Maven coordinates Copy linkLink copied to clipboard!
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-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-amqp</artifactId>
</dependency>
2.1.3. Usage Copy linkLink copied to clipboard!
2.1.3.1. Message mapping with org.w3c.dom.Node Copy linkLink copied to clipboard!
The Camel AMQP component supports message mapping between jakarta.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-xml-jaxp extension is present on the classpath.
2.1.3.2. Native mode support for jakarta.jms.ObjectMessage Copy linkLink copied to clipboard!
When sending JMS message payloads as jakarta.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. Refer to the native mode user guide for more information.
2.1.3.3. Connection Pooling Copy linkLink copied to clipboard!
You can use the quarkus-pooled-jms extension to get pooling support for the connections. Refer to the quarkus-pooled-jms extension documentation for more information.
Just add the following dependency to your pom.xml:
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId>
<artifactId>quarkus-pooled-jms</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId>
<artifactId>quarkus-pooled-jms</artifactId>
</dependency>
To enable the pooling support, you need to add the following configuration to your application.properties:
quarkus.qpid-jms.wrap=true
quarkus.qpid-jms.wrap=true
2.1.4. transferException option in native mode Copy linkLink copied to clipboard!
To use the transferException option in native mode, you must enable support for object serialization. Refer to the native mode user guide for more information.
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)
@RegisterForReflection(targets = { IllegalStateException.class, MyCustomException.class }, serialization = true)
2.1.5. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
The extension leverages the Quarkus Qpid JMS extension. A ConnectionFactory bean is automatically created and wired into the AMQP component for you. The connection factory can be configured via the Quarkus Qpid JMS configuration options.
2.2. Attachments Copy linkLink copied to clipboard!
Support for attachments on Camel messages
2.2.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.2.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-attachments</artifactId>
</dependency>
2.3. Avro Copy linkLink copied to clipboard!
Serialize and deserialize messages using Apache Avro binary data format.
2.3.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.3.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-avro</artifactId>
</dependency>
2.3.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
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
*.avscfiles in a folder namedsrc/main/avroorsrc/test/avro In addition to the usual
buildgoal ofquarkus-maven-plugin, add thegenerate-codegoal:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
See a working configuration in Camel Quarkus Avro integration test and Quarkus Avro integration test.
2.4. AWS 2 CloudWatch Copy linkLink copied to clipboard!
Sending metrics to AWS CloudWatch.
2.4.1. What’s inside Copy linkLink copied to clipboard!
-
AWS CloudWatch component, URI syntax:
aws2-cw:namespace
Refer to the above link for usage and configuration details.
2.4.2. Maven coordinates Copy linkLink copied to clipboard!
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-cw</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws2-cw</artifactId>
</dependency>
2.4.3. SSL in native mode Copy linkLink copied to clipboard!
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.5. AWS 2 DynamoDB Copy linkLink copied to clipboard!
Store and retrieve data from AWS DynamoDB service or receive messages from AWS DynamoDB Stream using AWS SDK version 2.x.
2.5.1. What’s inside Copy linkLink copied to clipboard!
-
AWS DynamoDB component, URI syntax:
aws2-ddb:tableName -
AWS DynamoDB Streams component, URI syntax:
aws2-ddbstream:tableName
Refer to the above links for usage and configuration details.
2.5.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws2-ddb</artifactId>
</dependency>
2.5.3. SSL in native mode Copy linkLink copied to clipboard!
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.5.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.5.4.1. Optional integration with Quarkus Amazon DynamoDB Copy linkLink copied to clipboard!
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. Follow the Quarkus documentation but beware of the following caveats:
The client type
apachehas to be selected by configuring the following property:quarkus.dynamodb.sync-client.type=apache
quarkus.dynamodb.sync-client.type=apacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
DynamoDbClienthas 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 injectingDynamoDbClient:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.6. AWS 2 Kinesis Copy linkLink copied to clipboard!
Consume and produce records from AWS Kinesis Streams using AWS SDK version 2.x.
2.6.1. What’s inside Copy linkLink copied to clipboard!
-
AWS Kinesis component, URI syntax:
aws2-kinesis:streamName -
AWS Kinesis Firehose component, URI syntax:
aws2-kinesis-firehose:streamName
Refer to the above links for usage and configuration details.
2.6.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws2-kinesis</artifactId>
</dependency>
2.6.3. SSL in native mode Copy linkLink copied to clipboard!
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. AWS 2 Lambda Copy linkLink copied to clipboard!
Manage and invoke AWS Lambda functions using AWS SDK version 2.x.
2.7.1. What’s inside Copy linkLink copied to clipboard!
-
AWS Lambda component, URI syntax:
aws2-lambda:function
Refer to the above link for usage and configuration details.
2.7.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws2-lambda</artifactId>
</dependency>
2.7.3. SSL in native mode Copy linkLink copied to clipboard!
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 Copy linkLink copied to clipboard!
2.7.4.1. Not possible to leverage quarkus-amazon-lambda by Camel aws2-lambda extension Copy linkLink copied to clipboard!
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.8. AWS 2 S3 Storage Service Copy linkLink copied to clipboard!
Store and retrieve objects from AWS S3 Storage Service.
2.8.1. What’s inside Copy linkLink copied to clipboard!
-
AWS S3 Storage Service component, URI syntax:
aws2-s3://bucketNameOrArn
Refer to the above link for usage and configuration details.
2.8.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws2-s3</artifactId>
</dependency>
2.8.3. SSL in native mode Copy linkLink copied to clipboard!
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 Copy linkLink copied to clipboard!
2.8.4.1. Optional integration with Quarkus Amazon S3 Copy linkLink copied to clipboard!
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. Follow the Quarkus documentation but beware of the following caveats:
The client type
apachehas to be selected by configuring the following property:quarkus.s3.sync-client.type=apache
quarkus.s3.sync-client.type=apacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
S3Clienthas 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 injectingS3Client:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.9. AWS 2 Simple Notification System (SNS) Copy linkLink copied to clipboard!
Send messages to AWS Simple Notification Topic.
2.9.1. What’s inside Copy linkLink copied to clipboard!
-
AWS Simple Notification System (SNS) component, URI syntax:
aws2-sns:topicNameOrArn
Refer to the above link for usage and configuration details.
2.9.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws2-sns</artifactId>
</dependency>
2.9.3. SSL in native mode Copy linkLink copied to clipboard!
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 Copy linkLink copied to clipboard!
2.9.4.1. Optional integration with Quarkus Amazon SNS Copy linkLink copied to clipboard!
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. Follow the Quarkus documentation but beware of the following caveats:
The client type
apachehas to be selected by configuring the following property:quarkus.sns.sync-client.type=apache
quarkus.sns.sync-client.type=apacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
SnsClienthas 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:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.10. AWS 2 Simple Queue Service (SQS) Copy linkLink copied to clipboard!
Send and receive messages to/from AWS SQS.
2.10.1. What’s inside Copy linkLink copied to clipboard!
-
AWS Simple Queue Service (SQS) component, URI syntax:
aws2-sqs:queueNameOrArn
Refer to the above link for usage and configuration details.
2.10.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws2-sqs</artifactId>
</dependency>
2.10.3. SSL in native mode Copy linkLink copied to clipboard!
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.10.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.10.4.1. Optional integration with Quarkus Amazon SQS Copy linkLink copied to clipboard!
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. Follow the Quarkus documentation but beware of the following caveats:
The client type
apachehas to be selected by configuring the following property:quarkus.sqs.sync-client.type=apache
quarkus.sqs.sync-client.type=apacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
SqsClienthas 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:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.11. Azure Event Hubs Copy linkLink copied to clipboard!
The azure-eventhubs component that integrates Azure Event Hubs using AMQP protocol. Azure EventHubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers.
2.11.1. What’s inside Copy linkLink copied to clipboard!
-
Azure Event Hubs component, URI syntax:
azure-eventhubs:namespace/eventHubName
Refer to the above link for usage and configuration details.
2.11.2. Maven coordinates Copy linkLink copied to clipboard!
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-eventhubs</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-azure-eventhubs</artifactId>
</dependency>
2.11.3. Usage Copy linkLink copied to clipboard!
2.11.3.1. Micrometer metrics support Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer</artifactId>
</dependency>
2.11.4. SSL in native mode Copy linkLink copied to clipboard!
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. Azure Key Vault Copy linkLink copied to clipboard!
Manage secrets and keys in Azure Key Vault Service
2.12.1. What’s inside Copy linkLink copied to clipboard!
-
Azure Key Vault component, URI syntax:
azure-key-vault:vaultName
Refer to the above link for usage and configuration details.
2.12.2. Maven coordinates Copy linkLink copied to clipboard!
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-key-vault</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-azure-key-vault</artifactId>
</dependency>
2.12.3. SSL in native mode Copy linkLink copied to clipboard!
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.13. Azure ServiceBus Copy linkLink copied to clipboard!
Send and receive messages to/from Azure Event Bus.
2.13.1. What’s inside Copy linkLink copied to clipboard!
-
Azure ServiceBus component, URI syntax:
azure-servicebus:topicOrQueueName
Refer to the above link for usage and configuration details.
2.13.2. Maven coordinates Copy linkLink copied to clipboard!
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-azure-servicebus</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-azure-servicebus</artifactId>
</dependency>
2.14. Azure Storage Blob Service Copy linkLink copied to clipboard!
Store and retrieve blobs from Azure Storage Blob Service using SDK v12.
2.14.1. What’s inside Copy linkLink copied to clipboard!
-
Azure Storage Blob Service component, URI syntax:
azure-storage-blob:accountName/containerName
Refer to the above link for usage and configuration details.
2.14.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-azure-storage-blob</artifactId>
</dependency>
2.14.3. Usage Copy linkLink copied to clipboard!
2.14.3.1. Micrometer metrics support Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer</artifactId>
</dependency>
2.14.4. SSL in native mode Copy linkLink copied to clipboard!
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.15. Azure Storage Queue Service Copy linkLink copied to clipboard!
The azure-storage-queue component is used for storing and retrieving the messages to/from Azure Storage Queue using Azure SDK v12.
2.15.1. What’s inside Copy linkLink copied to clipboard!
-
Azure Storage Queue Service component, URI syntax:
azure-storage-queue:accountName/queueName
Refer to the above link for usage and configuration details.
2.15.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-azure-storage-queue</artifactId>
</dependency>
2.15.3. Usage Copy linkLink copied to clipboard!
2.15.3.1. Micrometer metrics support Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer</artifactId>
</dependency>
2.15.4. SSL in native mode Copy linkLink copied to clipboard!
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.16. Bean Validator Copy linkLink copied to clipboard!
Validate the message body using the Java Bean Validation API.
2.16.1. What’s inside Copy linkLink copied to clipboard!
-
Bean Validator component, URI syntax:
bean-validator:label
Refer to the above link for usage and configuration details.
2.16.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bean-validator</artifactId>
</dependency>
2.16.3. Usage Copy linkLink copied to clipboard!
2.16.3.1. Configuring the ValidatorFactory Copy linkLink copied to clipboard!
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.16.3.2. Custom validation groups in native mode Copy linkLink copied to clipboard!
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 {
}
@RegisterForReflection
public interface OptionalChecks {
}
2.16.4. Camel Quarkus limitations Copy linkLink copied to clipboard!
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.17. Bean Copy linkLink copied to clipboard!
Invoke methods of Java beans
2.17.1. What’s inside Copy linkLink copied to clipboard!
-
Bean component, URI syntax:
bean:beanName - Bean Method language
-
Class component, URI syntax:
class:beanName
Refer to the above links for usage and configuration details.
2.17.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bean</artifactId>
</dependency>
2.17.3. Usage Copy linkLink copied to clipboard!
Except for invoking methods of beans available in Camel registry, Bean component and Bean method language can also invoke Quarkus CDI beans. For more details, Refer to the CDI and the Camel Bean component section of the User guide.
2.18. BeanIO Copy linkLink copied to clipboard!
Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats).
2.18.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.18.2. Maven coordinates Copy linkLink copied to clipboard!
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-beanio</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-beanio</artifactId>
</dependency>
2.19. Bindy Copy linkLink copied to clipboard!
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.19.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above links for usage and configuration details.
2.19.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bindy</artifactId>
</dependency>
2.19.3. Camel Quarkus limitations Copy linkLink copied to clipboard!
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");
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.20. Browse Copy linkLink copied to clipboard!
Inspect the messages received on endpoints supporting BrowsableEndpoint.
2.20.1. What’s inside Copy linkLink copied to clipboard!
-
Browse component, URI syntax:
browse:name
Refer to the above link for usage and configuration details.
2.20.2. Maven coordinates Copy linkLink copied to clipboard!
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-browse</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-browse</artifactId>
</dependency>
2.21. Cassandra CQL Copy linkLink copied to clipboard!
Integrate with Cassandra 2.0 using the CQL3 API (not the Thrift API). Based on Cassandra Java Driver provided by DataStax.
2.21.1. What’s inside Copy linkLink copied to clipboard!
-
Cassandra CQL component, URI syntax:
cql:beanRef:hosts:port/keyspace
Refer to the above link for usage and configuration details.
2.21.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-cassandraql</artifactId>
</dependency>
2.21.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.21.3.1. Cassandra aggregation repository in native mode Copy linkLink copied to clipboard!
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.22. CLI Connector Copy linkLink copied to clipboard!
Runtime adapter connecting with Camel CLI
2.22.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.22.2. Maven coordinates Copy linkLink copied to clipboard!
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-cli-connector</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-cli-connector</artifactId>
</dependency>
2.22.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
Sets whether to enable Camel CLI Connector support. |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.23. Control Bus Copy linkLink copied to clipboard!
Manage and monitor Camel routes.
2.23.1. What’s inside Copy linkLink copied to clipboard!
-
Control Bus component, URI syntax:
controlbus:command:language
Refer to the above link for usage and configuration details.
2.23.2. Maven coordinates Copy linkLink copied to clipboard!
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-controlbus</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-controlbus</artifactId>
</dependency>
2.23.3. Usage Copy linkLink copied to clipboard!
2.23.3.1. Statistics Copy linkLink copied to clipboard!
When using the stats command endpoint, the camel-quarkus-management extension must be added as a project dependency to enable JMX. Maven users will have to add the following to their pom.xml:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-management</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-management</artifactId>
</dependency>
2.23.3.2. Languages Copy linkLink copied to clipboard!
The following languages are supported for use in the Control Bus extension in Red Hat build of Apache Camel for Quarkus:
2.23.3.2.1. Bean Copy linkLink copied to clipboard!
The Bean language can be used to invoke a method on a bean to control the state of routes. The org.apache.camel.quarkus:camel-quarkus-bean extension must be added to the classpath. Maven users must add the following dependency to the POM:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bean</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bean</artifactId>
</dependency>
In native mode, the bean class must be annotated with @RegisterForReflection.
2.23.3.2.2. Simple Copy linkLink copied to clipboard!
The Simple language can be used to control the state of routes. The following example uses a ProducerTemplate to stop a route with the id foo:
template.sendBody(
"controlbus:language:simple",
"${camelContext.getRouteController().stopRoute('foo')}"
);
template.sendBody(
"controlbus:language:simple",
"${camelContext.getRouteController().stopRoute('foo')}"
);
To use the OGNL notation, the org.apache.camel.quarkus:camel-quarkus-bean extension must be added as a dependency.
In native mode, the classes used in the OGNL notation must be registered for reflection. In the above code snippet, the org.apache.camel.spi.RouteController class returned from camelContext.getRouteController() must be registered. As this is a third-party class, it cannot be annotated with @RegisterForReflection directly - instead you can annotate a different class and specifying the target classes to register. For example, the class defining the Camel routes could be annotated with @RegisterForReflection(targets = { org.apache.camel.spi.RouteController.class }).
Alternatively, add the following line to your src/main/resources/application.properties:
quarkus.camel.native.reflection.include-patterns = org.apache.camel.spi.RouteController
quarkus.camel.native.reflection.include-patterns = org.apache.camel.spi.RouteController
2.23.4. Camel Quarkus limitations Copy linkLink copied to clipboard!
2.23.4.1. Statistics Copy linkLink copied to clipboard!
The stats action is not available in native mode as JMX is not supported on GraalVM. Therefore, attempting to build a native image with the camel-quarkus-management extension on the classpath will result in a build failure.
This feature is not supported in Red Hat build of Apache Camel for Quarkus.
2.24. Core Copy linkLink copied to clipboard!
Camel core functionality and basic Camel languages: Constant, ExchangeProperty, Header, Ref, Simple and Tokenize
2.24.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above links for usage and configuration details.
2.24.2. Maven coordinates Copy linkLink copied to clipboard!
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>
2.24.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.24.3.1. Simple language Copy linkLink copied to clipboard!
2.24.3.1.1. Using the OGNL notation Copy linkLink copied to clipboard!
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.
2.24.3.1.2. Using dynamic type resolution in native mode Copy linkLink copied to clipboard!
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.
2.24.3.1.3. Using the simple language with classpath resources in native mode Copy linkLink copied to clipboard!
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
More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.
2.24.3.1.4. Configuring a custom bean via properties in native mode Copy linkLink copied to clipboard!
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 ** The excludes have higher precedence than includes. The excludes defined here can also be used to veto the discoverability of services included by Camel Quarkus extensions.
Example values: |
List of | |
|
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
Note that Camel Quarkus extensions may include some services by default. The services selected here added to those services and the exclusions defined in
Example values: |
List of | |
|
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: |
List of | |
|
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
Note that Camel Quarkus extensions may include some services by default. The services selected here added to those services and the exclusions defined in
Example values: |
List of | |
|
If
Setting this to |
|
|
|
If
Setting this to |
|
|
|
If
Setting this to |
|
|
|
If
Setting this to |
|
|
|
If
Setting this to |
|
|
|
If
Setting this to |
|
|
|
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/* |
List of | |
|
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/* |
List of | |
|
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
This option narrows down the set selected by This option cannot be used to unregister classes which have been registered internally by Quarkus extensions. |
List of | |
|
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
By default, no classes are included. The set selected by this option can be narrowed down by Note that Quarkus extensions typically register the required classes for reflection by themselves. This option is useful in situations when the built in functionality is not sufficient.
Note that this option enables the full reflective access for constructors, fields and methods. If you need a finer grained control, consider using For this option to work properly, at least one of the following conditions must be satisfied:
- There are no wildcards (
where |
List of | |
|
If |
|
|
|
What to do if it is not possible to extract CSimple expressions from a route definition at build time. |
|
|
|
What to do if it is not possible to extract expressions from a route definition at build time. |
|
|
|
Indicates whether the expression extraction from the route definitions at build time must be done. If disabled, the expressions are compiled at runtime. |
|
|
|
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 Note that this configuration item only has any effect when observers configured for Camel events are present in the application. |
|
|
|
Build time configuration options for enable/disable camel source location. |
|
|
|
Enables tracer in your Camel application. |
|
|
|
To set the tracer in standby mode, where the tracer will be installed, but not automatically enabled. The tracer can then be enabled explicitly later from Java, JMX or tooling. |
|
|
|
Defines how many of the last messages to keep in the tracer. |
|
|
|
Whether all traced messages should be removed when the tracer is dumping. By default, the messages are removed, which means that dumping will not contain previous dumped messages. |
|
|
|
To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size. |
|
|
|
Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching. |
|
|
|
Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file. |
|
|
|
Whether to include the exchange properties in the traced message. |
|
|
|
Whether to include the exchange variables in the traced message. |
|
|
|
Whether to include the exception in the traced message in case of failed exchange. |
|
|
|
Whether to trace routes that is created from Rest DSL. |
|
|
|
Whether to trace routes that is created from route templates or kamelets. |
|
|
|
Filter for tracing by route or node id. |
| |
|
Filter for tracing messages. |
| |
|
Whether type converter statistics are enabled. By default, type converter utilization statistics are disabled. Note that enabling statistics incurs a minor performance impact under very heavy load. |
|
|
|
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.
To write duration values, use the standard java.time.Duration format. See the Duration#parse() Java API documentation for more information.
You can also use a simplified format, starting with a number:
- If the value is only a number, it represents time in seconds.
-
If the value is a number followed by
ms, it represents time in milliseconds.
In other cases, the simplified format is translated to the java.time.Duration format for parsing:
-
If the value is a number followed by
h,m, ors, it is prefixed withPT. -
If the value is a number followed by
d, it is prefixed withP.
2.25. Cron Copy linkLink copied to clipboard!
A generic interface for triggering events at times specified through the Unix cron syntax.
2.25.1. What’s inside Copy linkLink copied to clipboard!
-
Cron component, URI syntax:
cron:name
Refer to the above link for usage and configuration details.
2.25.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-cron</artifactId>
</dependency>
2.25.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
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.26. Crypto (JCE) Copy linkLink copied to clipboard!
Sign and verify exchanges using the Signature Service of the Java Cryptographic Extension (JCE).
2.26.1. What’s inside Copy linkLink copied to clipboard!
- Crypto (Java Cryptographic Extension) data format
-
Crypto (JCE) component, URI syntax:
crypto:cryptoOperation:name
Refer to the above links for usage and configuration details.
2.26.2. Maven coordinates Copy linkLink copied to clipboard!
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-crypto</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-crypto</artifactId>
</dependency>
2.26.3. Usage Copy linkLink copied to clipboard!
2.26.3.1. Security Provider Copy linkLink copied to clipboard!
Extension requires BouncyCastle provider and also utilizes the quarkus security extension (see security providers registration doc) If there is no BC* provider registered (by quarkus.security.security-providers property). The BC provider is registered.
2.26.3.2. FIPS Copy linkLink copied to clipboard!
When running the crypto extension on FIPS enabled system any FIPS-compliant Java Security Provider (such as BCFIPS) has to be used.
-
In the case of BCFIPS, add BCFIPS dependency and
quarkus-security(see the guide for more information)
and register BCFIPS provider with following proprerty:
quarkus.security.security-providers=BCFIPS
quarkus.security.security-providers=BCFIPS
- Alternatively, you can add different FIPS compliant provider. Make Sure that the provider is registered.
2.26.4. Camel Quarkus limitations Copy linkLink copied to clipboard!
2.26.5. SSL in native mode Copy linkLink copied to clipboard!
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.27. CXF Copy linkLink copied to clipboard!
Expose SOAP WebServices using Apache CXF or connect to external WebServices using CXF WS client.
2.27.1. What’s inside Copy linkLink copied to clipboard!
-
CXF component, URI syntax:
cxf:beanId:address
Refer to the above link for usage and configuration details.
2.27.2. Maven coordinates Copy linkLink copied to clipboard!
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-cxf-soap</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-cxf-soap</artifactId>
</dependency>
2.27.3. Usage Copy linkLink copied to clipboard!
2.27.3.1. General Copy linkLink copied to clipboard!
camel-quarkus-cxf-soap uses extensions from the CXF Extensions for Quarkus project - quarkus-cxf. This means the set of supported use cases and WS specifications is largely given by quarkus-cxf.
To learn about supported use cases and WS specifications, see the Quarkus CXF Reference.
2.27.3.2. Dependency management Copy linkLink copied to clipboard!
The CXF and quarkus-cxf versions are managed by {project-name}. You do not need select compatible versions for those projects.
2.27.3.3. Client Copy linkLink copied to clipboard!
With camel-quarkus-cxf-soap (no additional dependencies required), you can use CXF clients as producers in Camel routes:
The CalculatorService may look like the following:
You can test this client application against the quay.io/l2x6/calculator-ws:1.2 container that implements this service endpoint interface:
docker run -p 8082:8080 quay.io/l2x6/calculator-ws:1.2
docker run -p 8082:8080 quay.io/l2x6/calculator-ws:1.2
quarkus-cxf supports injecting SOAP clients using @io.quarkiverse.cxf.annotation.CXFClient annotation. Refer to the SOAP Clients chapter of quarkus-cxf user guide for more details.
2.27.3.4. Server Copy linkLink copied to clipboard!
With camel-quarkus-cxf-soap, you can expose SOAP endpoints as consumers in Camel routes. No additional dependencies are required for this use case.
The path under which these two services will be served depends on the value of quarkus.cxf.pathconfiguration property which can for example be set in application.properties:
application.properties
quarkus.cxf.path = /soap-services
quarkus.cxf.path = /soap-services
With this configuration in place, our two services can be reached under http://localhost:8080/soap-services/hello-bean and http://localhost:8080/soap-services/hello-inline respectively.
The WSDL can be accessed by adding ?wsdl to the above URLs.
Do not use quarkus.cxf.path = / in your application unless you are 100% sure that no other extension will want to expose HTTP endpoints.
Before quarkus-cxf 2.0.0 (i.e. before {project-name} 3.0.0), the default value of quarkus.cxf.path was /. The default was changed because it prevented other Quarkus extensions from exposing any further HTTP endpoints. Among others, RESTEasy, Vert.x, SmallRye Health (no health endpoints exposed!) were impacted by this.
quarkus-cxf supports alternative ways of exposing SOAP endpoints. Refer to the SOAP Services chapter of quarkus-cxf user guide for more details.
2.27.3.5. Logging of requests and responses Copy linkLink copied to clipboard!
You can enable verbose logging of SOAP messages for both clients and servers with org.apache.cxf.ext.logging.LoggingFeature:
The support for org.apache.cxf.ext.logging.LoggingFeature is provided by io.quarkiverse.cxf:quarkus-cxf-rt-features-logging as a camel-quarkus-cxf-soap dependency. You do not need to add it explicitly to your application.
2.27.3.6. WS Specifications Copy linkLink copied to clipboard!
The extent of supported WS specifications is given by the Quarkus CXF project.
camel-quarkus-cxf-soap covers only the following specifications via the io.quarkiverse.cxf:quarkus-cxf extension:
- JAX-WS
- JAXB
- WS-Addressing
- WS-Policy
- MTOM
If your application requires some other WS specification, such as WS-Security or WS-Trust, you must add an additional Quarkus CXF dependency covering it. Refer to Quarkus CXF Reference page to see which WS specifications are covered by which Quarkus CXF extensions.
Both {project-name} and Quarkus CXF contain a number of integration tests which can serve as executable examples of applications that implement various WS specifications.
2.27.3.7. Tooling Copy linkLink copied to clipboard!
quarkus-cxf wraps the following two CXF tools:
-
wsdl2Java- for generating service classes from WSDL -
java2ws- for generating WSDL from Java classes
For wsdl2Java to work properly, your application will have to directly depend on io.quarkiverse.cxf:quarkus-cxf.
While wsdlvalidator is not supported, you can use wsdl2Java with the following configuration in application.properties to validate your WSDLs:
application.properties
quarkus.cxf.codegen.wsdl2java.additional-params = -validate
quarkus.cxf.codegen.wsdl2java.additional-params = -validate
2.27.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
For CXF service interfaces to work properly, some ancillary classes (such as request and response wrappers) need to be generated at build time. Camel Quarkus lets the
|
List of |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.28. Data Format Copy linkLink copied to clipboard!
Use a Camel Data Format as a regular Camel Component. For more details of the supported data formats in {project-name}, see Supported Data Formats.
2.28.1. What’s inside Copy linkLink copied to clipboard!
-
Data Format component, URI syntax:
dataformat:name:operation
Refer to the above link for usage and configuration details.
2.28.2. Maven coordinates Copy linkLink copied to clipboard!
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-dataformat</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-dataformat</artifactId>
</dependency>
2.29. Dataset Copy linkLink copied to clipboard!
Provide data for load and soak testing of your Camel application.
2.29.1. What’s inside Copy linkLink copied to clipboard!
-
Dataset component, URI syntax:
dataset:name -
DataSet Test component, URI syntax:
dataset-test:name
Refer to the above links for usage and configuration details.
2.29.2. Maven coordinates Copy linkLink copied to clipboard!
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-dataset</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-dataset</artifactId>
</dependency>
2.30. Direct Copy linkLink copied to clipboard!
Call another endpoint from the same Camel Context synchronously.
2.30.1. What’s inside Copy linkLink copied to clipboard!
-
Direct component, URI syntax:
direct:name
Refer to the above link for usage and configuration details.
2.30.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-direct</artifactId>
</dependency>
2.31. Elasticsearch Copy linkLink copied to clipboard!
Send requests to ElasticSearch via Java Client API.
2.31.1. What’s inside Copy linkLink copied to clipboard!
-
Elasticsearch component, URI syntax:
elasticsearch:clusterName
Refer to the above link for usage and configuration details.
2.31.2. Maven coordinates Copy linkLink copied to clipboard!
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-elasticsearch</artifactId>
</dependency>
2.32. Elasticsearch Low level Rest Client Copy linkLink copied to clipboard!
Perform queries and other operations on Elasticsearch or OpenSearch (uses low-level client).
2.32.1. What’s inside Copy linkLink copied to clipboard!
-
Elasticsearch Low level Rest Client component, URI syntax:
elasticsearch-rest-client:clusterName
Refer to the above link for usage and configuration details.
2.32.2. Maven coordinates Copy linkLink copied to clipboard!
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-elasticsearch-rest-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-elasticsearch-rest-client</artifactId>
</dependency>
2.33. FHIR Copy linkLink copied to clipboard!
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.33.1. What’s inside Copy linkLink copied to clipboard!
-
FHIR component, URI syntax:
fhir:apiName/methodName - FHIR JSon data format
- FHIR XML data format
Refer to the above links for usage and configuration details.
2.33.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-fhir</artifactId>
</dependency>
2.33.3. SSL in native mode Copy linkLink copied to clipboard!
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.33.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
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.34. File Copy linkLink copied to clipboard!
Read and write files.
2.34.1. What’s inside Copy linkLink copied to clipboard!
-
File component, URI syntax:
file:directoryName
Refer to the above link for usage and configuration details.
2.34.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-file</artifactId>
</dependency>
2.35. File Cluster Service Copy linkLink copied to clipboard!
Provides a FileLock implementation of the Camel Cluster Service SPI
2.35.1. Maven coordinates Copy linkLink copied to clipboard!
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-cluster-service</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-file-cluster-service</artifactId>
</dependency>
2.35.2. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.35.2.1. Having only a single consumer in a cluster consuming from a given endpoint Copy linkLink copied to clipboard!
When the same route is deployed on multiple JVMs, it could be interesting to use this extension in conjunction with the Master one. In such a setup, a single consumer will be active at a time across the whole camel master namespace.
For instance, having the route below deployed on multiple JVMs:
from("master:ns:timer:test?period=100").log("Timer invoked on a single JVM at a time");
from("master:ns:timer:test?period=100").log("Timer invoked on a single JVM at a time");
It’s possible to configure the file cluster service with a property like below:
quarkus.camel.cluster.file.root = target/cluster-folder-where-lock-file-will-be-held
quarkus.camel.cluster.file.root = target/cluster-folder-where-lock-file-will-be-held
As a result, a single consumer will be active across the ns camel master namespace. It means that, at a given time, only a single timer will generate exchanges across all JVMs. In other words, messages will be logged every 100ms on a single JVM at a time.
The file cluster service could further be tuned by tweaking quarkus.camel.cluster.file.* properties.
| Configuration property | Type | Default |
|---|---|---|
|
Whether a File Lock Cluster Service should be automatically configured according to 'quarkus.camel.cluster.file.*' configurations. |
|
|
|
The cluster service ID (defaults to null). |
| |
|
The root path (defaults to null). |
| |
|
The service lookup order/priority (defaults to 2147482647). |
| |
|
[[quarkus-camel-cluster-file-attributes—attributes]] The custom attributes associated to the service (defaults to empty map). |
| |
|
The time to wait before starting to try to acquire lock (defaults to 1000ms). |
| |
|
The time to wait between attempts to try to acquire lock (defaults to 10000ms). |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.36. Flink Copy linkLink copied to clipboard!
Send DataSet jobs to an Apache Flink cluster.
2.36.1. What’s inside Copy linkLink copied to clipboard!
-
Flink component, URI syntax:
flink:endpointType
Refer to the above link for usage and configuration details.
2.36.2. Maven coordinates Copy linkLink copied to clipboard!
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-flink</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-flink</artifactId>
</dependency>
2.37. FTP Copy linkLink copied to clipboard!
Upload and download files to/from SFTP, FTP or SFTP servers
2.37.1. What’s inside Copy linkLink copied to clipboard!
-
FTP component, URI syntax:
ftp:host:port/directoryName -
FTPS component, URI syntax:
ftps:host:port/directoryName -
SFTP component, URI syntax:
sftp:host:port/directoryName
Refer to the above links for usage and configuration details.
2.37.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-ftp</artifactId>
</dependency>
2.38. Google BigQuery Copy linkLink copied to clipboard!
Access Google Cloud BigQuery service using SQL queries or Google Client Services API
2.38.1. What’s inside Copy linkLink copied to clipboard!
-
Google BigQuery component, URI syntax:
google-bigquery:projectId:datasetId:tableId -
Google BigQuery Standard SQL component, URI syntax:
google-bigquery-sql:projectId:queryString
Refer to the above links for usage and configuration details.
2.38.2. Maven coordinates Copy linkLink copied to clipboard!
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-google-bigquery</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-bigquery</artifactId>
</dependency>
2.38.3. Usage Copy linkLink copied to clipboard!
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. Check Quarkus documentation for more details.
2.39. Google Pubsub Copy linkLink copied to clipboard!
Send and receive messages to/from Google Cloud Platform PubSub Service.
2.39.1. What’s inside Copy linkLink copied to clipboard!
-
Google Pubsub component, URI syntax:
google-pubsub:projectId:destinationName
Refer to the above link for usage and configuration details.
2.39.2. Maven coordinates Copy linkLink copied to clipboard!
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-google-pubsub</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-pubsub</artifactId>
</dependency>
2.39.3. Camel Quarkus limitations Copy linkLink copied to clipboard!
By default, the Camel PubSub component uses JDK object serialization via ObjectOutputStream whenever the message body is anything other than String or byte[].
Since such serialization is not yet supported by GraalVM, this extension provides a custom Jackson based serializer to serialize complex message payloads as JSON.
If your payload contains binary data, then you will need to handle that by creating a custom Jackson Serializer / Deserializer. Refer to the Quarkus Jackson guide for information on how to do this.
2.40. Google Secret Manager Copy linkLink copied to clipboard!
Manage Google Secret Manager Secrets
2.40.1. What’s inside Copy linkLink copied to clipboard!
-
Google Secret Manager component, URI syntax:
google-secret-manager:project
Refer to the above link for usage and configuration details.
2.40.2. Maven coordinates Copy linkLink copied to clipboard!
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-secret-manager</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-secret-manager</artifactId>
</dependency>
2.41. GraphQL Copy linkLink copied to clipboard!
Send GraphQL queries and mutations to external systems.
2.41.1. What’s inside Copy linkLink copied to clipboard!
-
GraphQL component, URI syntax:
graphql:httpUri
Refer to the above link for usage and configuration details.
2.41.2. Maven coordinates Copy linkLink copied to clipboard!
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-graphql</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-graphql</artifactId>
</dependency>
2.41.3. SSL in native mode Copy linkLink copied to clipboard!
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.41.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
A comma separated list of paths to files containing GraphQL queries for use by GraphQL endpoints. Query files that only need to be accessible from the classpath should be specified on this property. Paths can either be schemeless (E.g graphql/my-query.graphql) or be prefixed with the classpath: URI scheme (E.g classpath:graphql/my-query.graphql). Other URI schemes are not supported. |
List of |
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.42. gRPC Copy linkLink copied to clipboard!
Expose gRPC endpoints and access external gRPC endpoints.
2.42.1. What’s inside Copy linkLink copied to clipboard!
-
gRPC component, URI syntax:
grpc:host:port/service
Refer to the above link for usage and configuration details.
2.42.2. Maven coordinates Copy linkLink copied to clipboard!
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-grpc</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-grpc</artifactId>
</dependency>
2.42.3. Usage Copy linkLink copied to clipboard!
2.42.3.1. Protobuf generated code Copy linkLink copied to clipboard!
Camel Quarkus gRPC can generate gRPC service stubs for .proto files. When using Maven, ensure that you have enabled the generate-code goals of the quarkus-maven-plugin in your project build.
With this configuration, you can put your service and message definitions into the src/main/proto directory and the quarkus-maven-plugin will generate code from your .proto files.
2.42.3.1.1. Scanning proto files with imports Copy linkLink copied to clipboard!
The Protocol Buffers specification provides a way to import proto files. You can control the scope of dependencies to scan by adding configuration property quarkus.camel.grpc.codegen.scan-for-imports property to application.properties. The available options are outlined below.
-
all- Scan all dependencies -
none- Disable dependency scanning. Use only the proto definitions defined insrc/main/protoorsrc/test/proto -
groupId1:artifactId1,groupId2:artifactId2- Scan only the dependencies matching thegroupIdandartifactIdlist
The default value is com.google.protobuf:protobuf-java.
2.42.3.1.2. Scanning proto files from dependencies Copy linkLink copied to clipboard!
If you have proto files shared across multiple dependencies, you can generate gRPC service stubs for them by adding configuration property quarkus.camel.grpc.codegen.scan-for-proto to application.properties.
First add a dependency for the artifact(s) containing proto files to your project. Next, enable proto file dependency scanning.
quarkus.camel.grpc.codegen.scan-for-proto=org.my.groupId1:my-artifact-id-1,org.my.groupId2:my-artifact-id-2
quarkus.camel.grpc.codegen.scan-for-proto=org.my.groupId1:my-artifact-id-1,org.my.groupId2:my-artifact-id-2
It is possible to include / exclude specific proto files from dependency scanning via configuration properties.
The configuration property name suffix is the Maven groupId / artifactId for the dependency to configure includes / excludes on. Paths are relative to the classpath location of the proto files within the dependency. Paths can be an explicit path to a proto file, or as glob patterns to include / exclude multiple files.
quarkus.camel.grpc.codegen.scan-for-proto-includes."<groupId>\:<artifactId>"=foo/**,bar/**,baz/a-proto.proto quarkus.camel.grpc.codegen.scan-for-proto-excludes."<groupId>\:<artifactId>"=foo/private/**,baz/another-proto.proto
quarkus.camel.grpc.codegen.scan-for-proto-includes."<groupId>\:<artifactId>"=foo/**,bar/**,baz/a-proto.proto
quarkus.camel.grpc.codegen.scan-for-proto-excludes."<groupId>\:<artifactId>"=foo/private/**,baz/another-proto.proto
The : character within property keys must be escaped with \.
2.42.3.2. Accessing classpath resources in native mode Copy linkLink copied to clipboard!
The gRPC component has various options where resources are resolved from the classpath:
-
keyCertChainResource -
keyResource -
serviceAccountResource -
trustCertCollectionResource
When using these options in native mode, you must ensure that any such resources are included in the native image.
This can be accomplished by adding the configuration property quarkus.native.resources.includes to application.properties. For example, to include SSL / TLS keys and certificates.
quarkus.native.resources.includes = certs/*.pem,certs.*.key
quarkus.native.resources.includes = certs/*.pem,certs.*.key
More information about selecting resources for inclusion in the native executable can be found in the native mode guide.
2.42.4. Camel Quarkus limitations Copy linkLink copied to clipboard!
2.42.4.1. Integration with Quarkus gRPC is not supported Copy linkLink copied to clipboard!
At present there is no support for integrating Camel Quarkus gRPC with Quarkus gRPC. If you have both the camel-quarkus-grpc and quarkus-grpc extension dependency on the classpath, you are likely to encounter problems at build time when compiling your application.
2.42.5. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
If |
|
|
|
Camel Quarkus gRPC code generation can scan application dependencies for .proto files to generate Java stubs from them. This property sets the scope of the dependencies to scan. Applicable values: - none - default - don’t scan dependencies - a comma separated list of groupId:artifactId coordinates to scan - all - scan all dependencies |
|
|
|
Camel Quarkus gRPC code generation can scan dependencies for .proto files that can be imported by protos in this applications. Applicable values: - none - default - don’t scan dependencies - a comma separated list of groupId:artifactId coordinates to scan - all - scan all dependencies The default is com.google.protobuf:protobuf-java. |
|
|
|
[[quarkus-camel-grpc-codegen-scan-for-proto-includes—scan-for-proto-includes]] Package path or file glob pattern includes per dependency containing .proto files to be considered for inclusion. |
| |
|
[[quarkus-camel-grpc-codegen-scan-for-proto-excludes—scan-for-proto-excludes]] Package path or file glob pattern includes per dependency containing .proto files to be considered for exclusion. |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.43. Gson Copy linkLink copied to clipboard!
Marshal POJOs to JSON and back using Gson
2.43.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.43.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-gson</artifactId>
</dependency>
2.43.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.43.3.1. Marshaling/Unmarshaling objects in native mode Copy linkLink copied to clipboard!
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.44. HL7 Copy linkLink copied to clipboard!
Marshal and unmarshal HL7 (Health Care) model objects using the HL7 MLLP codec.
2.44.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above links for usage and configuration details.
2.44.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-hl7</artifactId>
</dependency>
2.44.3. Camel Quarkus limitations Copy linkLink copied to clipboard!
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.45. HTTP Copy linkLink copied to clipboard!
Send requests to external HTTP servers using Apache HTTP Client 5.x.
2.45.1. What’s inside Copy linkLink copied to clipboard!
-
HTTP component, URI syntax:
http://httpUri -
HTTPS (Secure) component, URI syntax:
https://httpUri
Refer to the above links for usage and configuration details.
2.45.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-http</artifactId>
</dependency>
2.45.3. SSL in native mode Copy linkLink copied to clipboard!
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.45.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
- Check the Character encodings section of the Native mode guide if you expect your application to send or receive requests using non-default encodings.
2.46. Hashicorp Vault Copy linkLink copied to clipboard!
Manage secrets in Hashicorp Vault Service
2.46.1. What’s inside Copy linkLink copied to clipboard!
-
Hashicorp Vault component, URI syntax:
hashicorp-vault:secretsEngine
Refer to the above link for usage and configuration details.
2.46.2. Maven coordinates Copy linkLink copied to clipboard!
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-hashicorp-vault</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-hashicorp-vault</artifactId>
</dependency>
2.46.3. Usage Copy linkLink copied to clipboard!
2.46.3.1. Using a POJO for the createSecret operation in native mode Copy linkLink copied to clipboard!
It is possible to use a POJO as the message body for the createSecret operation. In native mode, you must register any such POJO classes for reflection. E.g. via the @RegisterForReflection annotation or configuration property quarkus.camel.native.reflection.include-patterns.
For example.
Refer to the Native mode user guide for more information.
2.47. Infinispan Copy linkLink copied to clipboard!
Read and write from/to Infinispan distributed key/value store and data grid.
2.47.1. What’s inside Copy linkLink copied to clipboard!
-
Infinispan component, URI syntax:
infinispan:cacheName
Refer to the above link for usage and configuration details.
2.47.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-infinispan</artifactId>
</dependency>
2.47.3. Usage Copy linkLink copied to clipboard!
2.47.3.1. Infinispan client configuration Copy linkLink copied to clipboard!
You can configure Camel Infinispan in one of two ways.
- Using the relevant Camel Infinispan component & endpoint options
- Using the Quarkus Infinispan extension configuration properties.
More details about these two configuration methods is described below.
2.47.3.2. Camel Infinispan component and endpoint configuration Copy linkLink copied to clipboard!
When using 'pure' Camel Infinispan component and endpoint configuration (I.e where’s there’s no quarkus.infinispan-client configuration set), you must disable generation of the default Quarkus Infinispan RemoteCacheManager bean by adding the following configuration to application.properties.
quarkus.infinispan-client.devservices.create-default-client=false
quarkus.infinispan-client.devservices.create-default-client=false
If you wish to take advantage of Quarkus Dev Services for Infinispan, the Camel Infinispan component can be configured as follows in application.properties.
2.47.3.3. Quarkus Infinispan configuration Copy linkLink copied to clipboard!
When using the Quarkus Infinispan extension configuration properties, the Quarkus Infinispan extensions creates and manages a RemoteCacheManager bean.
The bean will get automatically autowired into the Camel Infinispan component on application startup.
Note that to materialize the RemoteCacheManager beans, you must add injection points for them. For example:
2.47.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.47.4.1. Camel Infinispan InfinispanRemoteAggregationRepository in native mode Copy linkLink copied to clipboard!
If you chose to use the InfinispanRemoteAggregationRepository in native mode, then you must enable native serialization support.
2.48. Avro Jackson Copy linkLink copied to clipboard!
Marshal POJOs to Avro and back using Jackson.
2.48.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.48.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jackson-avro</artifactId>
</dependency>
2.49. Protobuf Jackson Copy linkLink copied to clipboard!
Marshal POJOs to Protobuf and back using Jackson.
2.49.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.49.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jackson-protobuf</artifactId>
</dependency>
2.50. Jackson Copy linkLink copied to clipboard!
Marshal POJOs to JSON and back using Jackson
2.50.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.50.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jackson</artifactId>
</dependency>
2.50.3. Usage Copy linkLink copied to clipboard!
2.50.3.1. Configuring the Jackson ObjectMapper Copy linkLink copied to clipboard!
There are a few ways of configuring the ObjectMapper that the JacksonDataFormat uses. These are outlined below.
2.50.3.1.1. ObjectMapper created internally by JacksonDataFormat Copy linkLink copied to clipboard!
By default, JacksonDataFormat will create its own ObjectMapper and use the various configuration options on the DataFormat to configure additional Jackson modules, pretty printing and other features.
2.50.3.1.2. Custom ObjectMapper for JacksonDataFormat Copy linkLink copied to clipboard!
You can pass a custom ObjectMapper instance to JacksonDataFormat as follows.
2.50.3.1.3. Using the Quarkus Jackson ObjectMapper with JacksonDataFormat Copy linkLink copied to clipboard!
The Quarkus Jackson extension exposes an ObjectMapper CDI bean which can be discovered by the JacksonDataFormat.
If you are using the JSON binding mode in the Camel REST DSL and want to use the Quarkus Jackson ObjectMapper, it can be achieved as follows.
You can perform customizations on the Quarkus ObjectMapper with a ObjectMapperCustomizer.
It’s also possible to @Inject the Quarkus ObjectMapper and pass it to the JacksonDataFormat.
2.51. JacksonXML Copy linkLink copied to clipboard!
Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson.
2.51.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.51.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jacksonxml</artifactId>
</dependency>
2.52. Jasypt Copy linkLink copied to clipboard!
Security using Jasypt
2.52.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.52.2. Maven coordinates Copy linkLink copied to clipboard!
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-jasypt</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jasypt</artifactId>
</dependency>
2.52.3. Usage Copy linkLink copied to clipboard!
The configuration of Jasypt in Camel Quarkus is driven by configuration properties.
The minimum expectation is that you provide a master password for Jasypt decryption with configuration property quarkus.camel.jasypt.password.
You can choose the encryption algorithm and other aspects of the Jasypt configuration via the quarkus.camel.jasypt options described below.
By default, you do not need to write custom code to configure the Camel JasyptPropertiesParser or PropertiesComponent. This is done for you automatically.
Any Camel configuration property added to application.properties can be secured with Jasypt. To encrypt a value, there is a utility that can be run with JBang.
jbang org.apache.camel:camel-jasypt:{camel-version} -c encrypt -p secret-password -i "Some secret content"
jbang org.apache.camel:camel-jasypt:{camel-version} -c encrypt -p secret-password -i "Some secret content"
If you choose to use a different Jasypt algorithm to the default (PBEWithMD5AndDES), you must provide -a (algorithm), -riga (IV generator algorithm) & -rsga (Salt generator algorithm) arguments to set the correct algorithms used in encryption. Else your application will not be able to decrypt configuration values.
Alternatively, when running in dev mode, open the Dev UI and click the 'utilities' link in the Camel Jasypt pane. Next, select either the 'Decrypt' or 'Encrypt' action, enter some text and click the submit button. The result of the action is output together with a button to copy it to the clipboard.
Configuration properties can be added to application.properties with the encrypted value enclosed within ENC() For example.
my.secret = ENC(BoDSRQfdBME4V/AcugPOkaR+IcyKufGz)
my.secret = ENC(BoDSRQfdBME4V/AcugPOkaR+IcyKufGz)
In your Camel routes, you can refer to the property name using the standard placeholder syntax and its value will get decrypted.
You can use the ability to mask security sensitive configuration in Camel by suffixing property values with .secret. You can also disable the startup configuration summary with the configuration camel.main.autoConfigurationLogSummary = false.
2.52.3.1. Injecting encrypted configuration Copy linkLink copied to clipboard!
You can use the @ConfigProperty annotation to inject encrypted configuration into your Camel routes or CDI beans.
2.52.3.1.1. Securing alternate configuration sources Copy linkLink copied to clipboard!
If you prefer to keep your secret configuration in a file separate to application.properties, you can use the quarkus.config.locations configuration option to specify additional configuration files.
In native mode you must also add any additional configuration file resource paths to quarkus.native.resources.includes.
2.52.3.1.2. Finer control of Jasypt configuration Copy linkLink copied to clipboard!
If you require finer control of the Jasypt configuration than that provided by the default configuration, the following options are available.
2.52.3.1.2.1. JasyptConfigurationCustomizer Copy linkLink copied to clipboard!
Implement a JasyptConfigurationCustomizer class to customize any aspect of the Jasypt EnvironmentStringPBEConfig.
In application.properties add the quarkus.camel.jasypt.configuration-customizer-class-name configuration property.
quarkus.camel.jasypt.configuration-customizer-class-name = org.acme.MyJasyptEncryptorCustomizer
quarkus.camel.jasypt.configuration-customizer-class-name = org.acme.MyJasyptEncryptorCustomizer
2.52.3.1.2.2. Disabling automatic Jasypt configuration Copy linkLink copied to clipboard!
If you prefer to use the 'classic' Java DSL way of configuring Camel Jasypt, you can disable the automatic configuration with quarkus.camel.jasypt.enabled = false.
This allows you to configure the Camel JasyptPropertiesParser and PropertiesComponent manually.
In this mode, you cannot use the @ConfigProperty annotation to inject encrypted configuration properties.
If you call setLocation(…) on the PropertiesComponent to specify a custom configuration file location using the classpath: prefix, you must add the file to quarkus.native.resources.includes so that it can be loaded in native mode.
2.52.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
Setting this option to false will disable Jasypt integration with Quarkus SmallRye configuration. You can however, manually configure Jasypt with Camel in the 'classic' way of manually configuring JasyptPropertiesParser and PropertiesComponent. Refer to the usage section for more details. |
|
|
|
The algorithm to be used for decryption. |
|
|
|
The master password used by Jasypt for decrypting configuration values. This option supports prefixes which influence the master password lookup behaviour.
|
| |
|
Configures the Jasypt StandardPBEStringEncryptor with a RandomIvGenerator using the given algorithm. |
|
|
|
Configures the Jasypt StandardPBEStringEncryptor with a RandomSaltGenerator using the given algorithm. |
|
|
|
The fully qualified class name of an org.apache.camel.quarkus.component.jasypt.JasyptConfigurationCustomizer implementation. This provides the optional capability of having full control over the Jasypt configuration. |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.53. Java jOOR DSL Copy linkLink copied to clipboard!
Support for parsing Java route definitions at runtime
2.53.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.53.2. Maven coordinates Copy linkLink copied to clipboard!
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-java-joor-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-java-joor-dsl</artifactId>
</dependency>
2.53.3. Camel Quarkus limitations Copy linkLink copied to clipboard!
The annotations added to the classes to be compiled by the component are ignored by Quarkus. The only annotation that is partially supported by the extension is the annotation RegisterForReflection to ease the configuration of the reflection for the native mode however, note that the element registerFullHierarchy is not supported.
2.54. JAXB Copy linkLink copied to clipboard!
Unmarshal XML payloads to POJOs and back using JAXB2 XML marshalling standard.
2.54.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.54.2. Maven coordinates Copy linkLink copied to clipboard!
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-jaxb</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jaxb</artifactId>
</dependency>
2.54.3. Usage Copy linkLink copied to clipboard!
2.54.3.1. Native mode ObjectFactory instantiation of non-JAXB annotated classes Copy linkLink copied to clipboard!
When performing JAXB marshal operations with a custom ObjectFactory to instantiate POJO classes that do not have JAXB annotations, you must register those POJO classes for reflection in order for them to be instantiated in native mode. E.g via the @RegisterForReflection annotation or configuration property quarkus.camel.native.reflection.include-patterns.
Refer to the Native mode user guide for more information.
2.55. JDBC Copy linkLink copied to clipboard!
Access databases through SQL and JDBC.
2.55.1. What’s inside Copy linkLink copied to clipboard!
-
JDBC component, URI syntax:
jdbc:dataSourceName
Refer to the above link for usage and configuration details.
2.55.2. Maven coordinates Copy linkLink copied to clipboard!
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-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jdbc</artifactId>
</dependency>
2.55.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.55.3.1. Configuring a DataSource Copy linkLink copied to clipboard!
This extension leverages Quarkus Agroal for DataSource support. Setting up a DataSource can be achieved via configuration properties. It is recommended that you explicitly name the datasource so that it can be referenced in the JDBC endpoint URI. E.g like to("jdbc:camel").
quarkus.datasource.camel.db-kind=postgresql quarkus.datasource.camel.username=your-username quarkus.datasource.camel.password=your-password quarkus.datasource.camel.jdbc.url=jdbc:postgresql://localhost:5432/your-database quarkus.datasource.camel.jdbc.max-size=16
quarkus.datasource.camel.db-kind=postgresql
quarkus.datasource.camel.username=your-username
quarkus.datasource.camel.password=your-password
quarkus.datasource.camel.jdbc.url=jdbc:postgresql://localhost:5432/your-database
quarkus.datasource.camel.jdbc.max-size=16
If you choose to not name the datasource, you can resolve the default DataSource by defining your endpoint like to("jdbc:default").
2.55.3.1.1. Zero configuration with Quarkus Dev Services Copy linkLink copied to clipboard!
In dev and test mode you can take advantage of Configuration Free Databases. All you need to do is reference the default database in your routes. E.g to("jdbc:default").
2.56. Jira Copy linkLink copied to clipboard!
Interact with JIRA issue tracker.
2.56.1. What’s inside Copy linkLink copied to clipboard!
-
Jira component, URI syntax:
jira:type
Refer to the above link for usage and configuration details.
2.56.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jira</artifactId>
</dependency>
2.56.3. SSL in native mode Copy linkLink copied to clipboard!
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.57. JMS Copy linkLink copied to clipboard!
Sent and receive messages to/from a JMS Queue or Topic.
2.57.1. What’s inside Copy linkLink copied to clipboard!
-
JMS component, URI syntax:
jms:destinationType:destinationName
Refer to the above link for usage and configuration details.
2.57.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jms</artifactId>
</dependency>
2.57.3. Usage Copy linkLink copied to clipboard!
2.57.3.1. Message mapping with org.w3c.dom.Node Copy linkLink copied to clipboard!
The Camel JMS component supports message mapping between jakarta.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-xml-jaxp extension is present on the classpath.
2.57.3.2. Native mode support for jakarta.jms.ObjectMessage Copy linkLink copied to clipboard!
When sending JMS message payloads as jakarta.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. Refer to the native mode user guide for more information.
2.57.3.3. Support for Connection pooling and X/Open XA distributed transactions Copy linkLink copied to clipboard!
Connection pooling is a Technical Preview feature in this release of {project-name}.
To use connection pooling in the camel-quarkus-jms components, you must add io.quarkiverse.artemis:quarkus-artemis and io.quarkiverse.messaginghub:quarkus-pooled-jms to your pom.xml and set the following configuration:
quarkus.pooled-jms.max-connections = 8
quarkus.pooled-jms.max-connections = 8
You can use the quarkus-pooled-jms extension to get pooling and XA support for JMS connections. Refer to the quarkus-pooled-jms extension documentation for more information. Currently, it can work with quarkus-artemis-jms, quarkus-qpid-jms and ibmmq-client. Just add the dependency to your pom.xml:
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId>
<artifactId>quarkus-pooled-jms</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId>
<artifactId>quarkus-pooled-jms</artifactId>
</dependency>
Pooling is enabled by default.
clientID and durableSubscriptionName are not supported in pooling connections. If setClientID is called on a reused connection from the pool, an IllegalStateException will be thrown. You will get some error messages such like Cause: setClientID can only be called directly after the connection is created
To enable XA, you need to add quarkus-narayana-jta extension:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-narayana-jta</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-narayana-jta</artifactId>
</dependency>
and add the following configuration to your application.properties:
quarkus.pooled-jms.transaction=xa quarkus.transaction-manager.enable-recovery=true
quarkus.pooled-jms.transaction=xa
quarkus.transaction-manager.enable-recovery=true
XA support is only available with quarkus-artemis-jms and ibmmq-client. Also We highly recommend to enable transaction recovery.
Since there is no quarkus extension for ibmmq-client currently, you need to create a custom ConnectionFactory and wrap it by yourself. Here is an example:
If you use ibmmq-client to consume messages and enable XA, you need to configure TransactionManager in the camel route like this:
Otherwise, you will get an exception like MQRC_SYNCPOINT_NOT_AVAILABLE.
When you are using ibmmq-client and rollback a transaction, there will be a WARN message like:
WARN [com.arj.ats.jta] (executor-thread-1) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=35, bqual_length=36, tx_uid=0:ffffc0a86510:aed3:650915d7:16, node_name=quarkus, branch_uid=0:ffffc0a86510:aed3:650915d7:1f, subordinatenodename=null, eis_name=0 > (com.ibm.mq.jmqi.JmqiXAResource@79786dde) failed with exception code XAException.XAER_NOTA: javax.transaction.xa.XAException: The method 'xa_rollback' has failed with errorCode '-4'.
WARN [com.arj.ats.jta] (executor-thread-1) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=35, bqual_length=36, tx_uid=0:ffffc0a86510:aed3:650915d7:16, node_name=quarkus, branch_uid=0:ffffc0a86510:aed3:650915d7:1f, subordinatenodename=null, eis_name=0 > (com.ibm.mq.jmqi.JmqiXAResource@79786dde) failed with exception code XAException.XAER_NOTA: javax.transaction.xa.XAException: The method 'xa_rollback' has failed with errorCode '-4'.
it may be ignored and can be assumed that MQ has discarded the transaction's work. Refer to https://access.redhat.com/solutions/1250743[Red Hat Knowledgebase] for more information.
it may be ignored and can be assumed that MQ has discarded the transaction's work. Refer to https://access.redhat.com/solutions/1250743[Red Hat Knowledgebase] for more information.
2.57.4. transferException option in native mode Copy linkLink copied to clipboard!
To use the transferException option in native mode, you must enable support for object serialization. Refer to the native mode user guide for more information.
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)
@RegisterForReflection(targets = { IllegalStateException.class, MyCustomException.class }, serialization = true)
2.58. JPA Copy linkLink copied to clipboard!
Store and retrieve Java objects from databases using Java Persistence API (JPA).
2.58.1. What’s inside Copy linkLink copied to clipboard!
-
JPA component, URI syntax:
jpa:entityType
Refer to the above link for usage and configuration details.
2.58.2. Maven coordinates Copy linkLink copied to clipboard!
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-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jpa</artifactId>
</dependency>
2.58.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
The extension leverages Quarkus Hibernate ORM to provide the JPA implementation via Hibernate.
Refer to the Quarkus Hibernate ORM documentation to see how to configure Hibernate and your datasource.
Also, it leverages Quarkus TX API to provide TransactionStrategy implementation.
When a single persistence unit is used, the Camel Quarkus JPA extension will automatically configure the JPA component with a EntityManagerFactory and TransactionStrategy.
2.58.3.1. Configuring JpaMessageIdRepository Copy linkLink copied to clipboard!
It needs to use EntityManagerFactory and TransactionStrategy from the CDI container to configure the JpaMessageIdRepository:
Since it excludes the spring-orm dependency, some options such as sharedEntityManager, transactionManager are not supported.
2.59. JSLT Copy linkLink copied to clipboard!
Query or transform JSON payloads using an JSLT.
2.59.1. What’s inside Copy linkLink copied to clipboard!
-
JSLT component, URI syntax:
jslt:resourceUri
Refer to the above link for usage and configuration details.
2.59.2. Maven coordinates Copy linkLink copied to clipboard!
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-jslt</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jslt</artifactId>
</dependency>
2.59.3. allowContextMapAll option in native mode Copy linkLink copied to clipboard!
The allowContextMapAll option is not supported in native mode as it requires reflective access to security sensitive camel core classes such as CamelContext & Exchange. This is considered a security risk and thus access to the feature is not provided by default.
2.59.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.59.4.1. Loading JSLT templates from classpath in native mode Copy linkLink copied to clipboard!
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:
from("direct:start").to("jslt:transformation.json");
from("direct:start").to("jslt:transformation.json");
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:
quarkus.native.resources.includes = *.json
quarkus.native.resources.includes = *.json
More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.
2.59.4.2. Using JSLT functions in native mode Copy linkLink copied to clipboard!
When using JSLT functions from camel-quarkus in native mode, the classes hosting the functions would need to be registered for reflection. When registering the target function is not possible, one may end up writing a stub as below.
The target function Math.pow(…) is now accessible through the MathFunctionStub class that could be registered in the component as below:
2.60. JSON Path Copy linkLink copied to clipboard!
Evaluate a JSONPath expression against a JSON message body
2.60.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.60.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jsonpath</artifactId>
</dependency>
2.61. JTA Copy linkLink copied to clipboard!
Enclose Camel routes in transactions using Java Transaction API (JTA) and Narayana transaction manager
2.61.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.61.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jta</artifactId>
</dependency>
2.61.3. Usage Copy linkLink copied to clipboard!
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")
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.62. JT400 Copy linkLink copied to clipboard!
Exchanges messages with an IBM i system using data queues, message queues, or program call. IBM i is the replacement for AS/400 and iSeries servers.
2.62.1. What’s inside Copy linkLink copied to clipboard!
-
JT400 component, URI syntax:
jt400:userID:password@systemName/QSYS.LIB/objectPath.type
Refer to the above link for usage and configuration details.
2.62.2. Maven coordinates Copy linkLink copied to clipboard!
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-jt400</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jt400</artifactId>
</dependency>
2.63. JQ Copy linkLink copied to clipboard!
Evaluates a JQ expression against a JSON message body.
2.63.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.63.2. Maven coordinates Copy linkLink copied to clipboard!
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-jq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jq</artifactId>
</dependency>
2.63.3. Usage Copy linkLink copied to clipboard!
2.63.3.1. JQ transformations to custom result types in native mode Copy linkLink copied to clipboard!
If you choose to perform JQ transformations that specify the result class as some custom type in native mode, then you must register that type for reflection.
E.g via the @RegisterForReflection annotation or configuration property quarkus.camel.native.reflection.include-patterns. For example:
@RegisterForReflection
public class Book {
...
}
@RegisterForReflection
public class Book {
...
}
Refer to the Native mode user guide for more information.
2.64. Kafka Copy linkLink copied to clipboard!
Sent and receive messages to/from an Apache Kafka broker.
2.64.1. What’s inside Copy linkLink copied to clipboard!
-
Kafka component, URI syntax:
kafka:topic
Refer to the above link for usage and configuration details.
2.64.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kafka</artifactId>
</dependency>
2.64.3. Usage Copy linkLink copied to clipboard!
2.64.3.1. Quarkus Kafka Dev Services Copy linkLink copied to clipboard!
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.64.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
If |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.65. Kamelet Copy linkLink copied to clipboard!
Materialize route templates
2.65.1. What’s inside Copy linkLink copied to clipboard!
-
Kamelet component, URI syntax:
kamelet:templateId/routeId
Refer to the above link for usage and configuration details.
2.65.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kamelet</artifactId>
</dependency>
2.65.3. Usage Copy linkLink copied to clipboard!
2.65.3.1. Using the Kamelet Catalog Copy linkLink copied to clipboard!
A set of pre-made Kamelets can be found in the Kamelet Catalog. To use a Kamelet from the catalog, you need to copy its YAML definition (that you can find in the camel-kamelets repository) to your project.
Alternatively, you can add the camel-kamelets dependency to your application.
<dependency>
<groupId>org.apache.camel.kamelets</groupId>
<artifactId>camel-kamelets</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.kamelets</groupId>
<artifactId>camel-kamelets</artifactId>
</dependency>
If the Kamelet requires the camel-kamelets-utils dependency, then this should also be added to your application.
2.66. Kubernetes Copy linkLink copied to clipboard!
Perform operations against Kubernetes API
2.66.1. Maven coordinates Copy linkLink copied to clipboard!
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-kubernetes</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kubernetes</artifactId>
</dependency>
2.66.2. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
In this release of Red Hat build of Apache Camel for Quarkus, the camel-quarkus-kubernetes extension is only supported when used with the camel-quarkus-master extension as a cluster service. Additionally, in order for the camel-quarkus-kubernetes extension to be supported, you must explicitly add a dependency on the quarkus-openshift-client extension in your application.
2.66.2.1. Automatic registration of a Kubernetes Client instance Copy linkLink copied to clipboard!
The extension automatically registers a Kubernetes Client bean named kubernetesClient. You can reference the bean in your routes like this:
from("direct:pods")
.to("kubernetes-pods:///?kubernetesClient=#kubernetesClient&operation=listPods")
from("direct:pods")
.to("kubernetes-pods:///?kubernetesClient=#kubernetesClient&operation=listPods")
By default the client is configured from the local kubeconfig file. You can customize the client configuration via properties within application.properties:
quarkus.kubernetes-client.master-url=https://my.k8s.host quarkus.kubernetes-client.namespace=my-namespace
quarkus.kubernetes-client.master-url=https://my.k8s.host
quarkus.kubernetes-client.namespace=my-namespace
The full set of configuration options are documented in the Quarkus Kubernetes Client guide.
2.67. Kubernetes Cluster Service Copy linkLink copied to clipboard!
Provides a Kubernetes implementation of the Camel Cluster Service SPI
2.67.1. Maven coordinates Copy linkLink copied to clipboard!
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-kubernetes-cluster-service</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kubernetes-cluster-service</artifactId>
</dependency>
2.67.2. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.67.2.1. Having only a single consumer in a cluster consuming from a given endpoint Copy linkLink copied to clipboard!
When the same route is deployed on multiple pods, it could be interesting to use this extension in conjunction with the Master one. In such a setup, a single consumer will be active at a time across the whole camel master namespace.
For instance, having the route below deployed on multiple pods:
from("master:ns:timer:test?period=100").log("Timer invoked on a single pod at a time");
from("master:ns:timer:test?period=100").log("Timer invoked on a single pod at a time");
As a result, a single consumer will be active across the ns camel master namespace. It means that, at a given time, only a single timer will generate exchanges across the whole cluster. In other words, messages will be logged every 100ms on a single pod at a time.
The kubernetes cluster service could further be tuned by tweaking quarkus.camel.cluster.kubernetes.* properties.
| Configuration property | Type | Default |
|---|---|---|
|
Whether a Kubernetes Cluster Service should be automatically configured according to 'quarkus.camel.cluster.kubernetes.*' configurations. |
|
|
|
Whether the camel master namespace leaders should be distributed evenly across all the camel contexts in the cluster. |
|
|
|
The cluster service ID (defaults to null). |
| |
|
The URL of the Kubernetes master (read from Kubernetes client properties by default). |
| |
|
The connection timeout in milliseconds to use when making requests to the Kubernetes API server. |
| |
|
The name of the Kubernetes namespace containing the pods and the configmap (autodetected by default). |
| |
|
The name of the current pod (autodetected from container host name by default). |
| |
|
The jitter factor to apply in order to prevent all pods to call Kubernetes APIs in the same instant (defaults to 1.2). |
| |
|
The default duration of the lease for the current leader (defaults to 15000). |
| |
|
The deadline after which the leader must stop its services because it may have lost the leadership (defaults to 10000). |
| |
|
The time between two subsequent attempts to check and acquire the leadership. It is randomized using the jitter factor (defaults to 2000). |
| |
|
Service lookup order/priority (defaults to 2147482647). |
| |
|
The name of the lease resource used to do optimistic locking (defaults to 'leaders'). The resource name is used as prefix when the underlying Kubernetes resource can manage a single lock. |
| |
|
The lease resource type used in Kubernetes, either 'config-map' or 'lease' (defaults to 'lease'). |
| |
|
[[quarkus-camel-cluster-kubernetes-labels—labels]] The labels key/value used to identify the pods composing the cluster, defaults to empty map. |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.68. Kudu Copy linkLink copied to clipboard!
Interact with Apache Kudu, a free and open source column-oriented data store of the Apache Hadoop ecosystem.
2.68.1. What’s inside Copy linkLink copied to clipboard!
-
Kudu component, URI syntax:
kudu:host:port/tableName
Refer to the above link for usage and configuration details.
2.68.2. Maven coordinates Copy linkLink copied to clipboard!
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-kudu</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kudu</artifactId>
</dependency>
2.68.3. SSL in native mode Copy linkLink copied to clipboard!
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.69. Language Copy linkLink copied to clipboard!
Execute scripts in any of the languages supported by Camel.
2.69.1. What’s inside Copy linkLink copied to clipboard!
-
Language component, URI syntax:
language:languageName:resourceUri
Refer to the above link for usage and configuration details.
2.69.2. Maven coordinates Copy linkLink copied to clipboard!
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-language</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-language</artifactId>
</dependency>
2.69.3. Usage Copy linkLink copied to clipboard!
2.69.3.1. Required Dependencies Copy linkLink copied to clipboard!
The Language extension only handles the passing of an Exchange to a script for execution. The extension implementing the language must be added as a dependency. The following list of languages are implemented in Core:
- Constant
- ExchangeProperty
- File
- Header
- Ref
- Simple
- Tokenize
To use any other language, you must add the corresponding dependency. Consult the Languages Guide for details.
2.69.3.2. Native Mode Copy linkLink copied to clipboard!
When loading scripts from the classpath in native mode, the path to the script file must be specified in the quarkus.native.resources.includes property of the application.properties file. For example:
quarkus.native.resources.includes=script.txt
quarkus.native.resources.includes=script.txt
2.69.4. allowContextMapAll option in native mode Copy linkLink copied to clipboard!
The allowContextMapAll option is not supported in native mode as it requires reflective access to security sensitive camel core classes such as CamelContext & Exchange. This is considered a security risk and thus access to the feature is not provided by default.
2.70. LDAP Copy linkLink copied to clipboard!
Perform searches on LDAP servers.
2.70.1. What’s inside Copy linkLink copied to clipboard!
-
LDAP component, URI syntax:
ldap:dirContextName
Refer to the above link for usage and configuration details.
2.70.2. Maven coordinates Copy linkLink copied to clipboard!
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-ldap</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-ldap</artifactId>
</dependency>
2.70.3. Usage Copy linkLink copied to clipboard!
2.70.3.1. Using SSL in Native Mode Copy linkLink copied to clipboard!
When using a custom SSLSocketFactory in native mode, such as the one in the Configuring SSL section, you need to register the class for reflection otherwise the class will not be made available on the classpath. Add the @RegisterForReflection annotation above the class definition, as follows:
@RegisterForReflection
public class CustomSSLSocketFactory extends SSLSocketFactory {
// The class definition is the same as in the above link.
}
@RegisterForReflection
public class CustomSSLSocketFactory extends SSLSocketFactory {
// The class definition is the same as in the above link.
}
2.71. LRA Copy linkLink copied to clipboard!
Camel saga binding for Long-Running-Action framework
2.71.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.71.2. Maven coordinates Copy linkLink copied to clipboard!
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-lra</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-lra</artifactId>
</dependency>
2.72. Log Copy linkLink copied to clipboard!
Prints data form the routed message (such as body and headers) to the logger.
2.72.1. What’s inside Copy linkLink copied to clipboard!
-
Log Data component, URI syntax:
log:loggerName
Refer to the above link for usage and configuration details.
2.72.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-log</artifactId>
</dependency>
2.73. Mail Copy linkLink copied to clipboard!
Send and receive emails using imap, pop3 and smtp protocols. Marshal Camel messages with attachments into MIME-Multipart messages and back.
2.73.1. What’s inside Copy linkLink copied to clipboard!
-
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
Refer to the above links for usage and configuration details.
2.73.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mail</artifactId>
</dependency>
2.74. Management Copy linkLink copied to clipboard!
JMX management strategy and associated managed resources.
2.74.1. Maven coordinates Copy linkLink copied to clipboard!
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-management</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-management</artifactId>
</dependency>
2.74.2. Usage Copy linkLink copied to clipboard!
For information on using Managed Beans in Camel, consult the JMX section of the Camel Manual.
2.74.2.1. Enabling and Disabling JMX Copy linkLink copied to clipboard!
JMX can be enabled or disabled in Camel-Quarkus by any of the following methods:
-
Adding or removing the
camel-quarkus-managementextension. -
Setting the
camel.main.jmxEnabledconfiguration property to a boolean value. -
Setting the system property
-Dorg.apache.camel.jmx.disabledto a boolean value.
2.74.2.2. Native mode Copy linkLink copied to clipboard!
Experimental JMX support was added for native executables in GraalVM for JDK 17/20 / Mandrel 23.0. You can enable this feature by adding the following configuration property to application.properties.
quarkus.native.monitoring=jmxserver
quarkus.native.monitoring=jmxserver
If you want the native application to be discoverable by tools such as JConsole and VisualVM, append the jvmstat option to the above mentioned configuration.
For more information, refer to the Quarkus native guide.
2.75. MapStruct Copy linkLink copied to clipboard!
Type Conversion using Mapstruct
2.75.1. What’s inside Copy linkLink copied to clipboard!
-
MapStruct component, URI syntax:
mapstruct:className
Refer to the above link for usage and configuration details.
2.75.2. Maven coordinates Copy linkLink copied to clipboard!
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-mapstruct</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mapstruct</artifactId>
</dependency>
2.75.3. Usage Copy linkLink copied to clipboard!
2.75.3.1. Annotation Processor Copy linkLink copied to clipboard!
To use MapStruct, you must configure your build to use an annotation processor.
2.75.3.1.1. Maven Copy linkLink copied to clipboard!
2.75.3.1.2. Gradle Copy linkLink copied to clipboard!
dependencies {
annotationProcessor 'org.mapstruct:mapstruct-processor:{mapstruct-version}'
testAnnotationProcessor 'org.mapstruct:mapstruct-processor:{mapstruct-version}'
}
dependencies {
annotationProcessor 'org.mapstruct:mapstruct-processor:{mapstruct-version}'
testAnnotationProcessor 'org.mapstruct:mapstruct-processor:{mapstruct-version}'
}
2.75.3.2. Mapper definition discovery Copy linkLink copied to clipboard!
By default, {project-name} will automatically discover the package paths of your @Mapper annotated interfaces or abstract classes and pass them to the Camel MapStruct component.
If you want finer control over the specific packages that are scanned, then you can set a configuration property in application.properties.
camel.component.mapstruct.mapper-package-name = com.first.package,org.second.package
camel.component.mapstruct.mapper-package-name = com.first.package,org.second.package
2.76. Master Copy linkLink copied to clipboard!
Have only a single consumer in a cluster consuming from a given endpoint; with automatic failover if the JVM dies.
2.76.1. What’s inside Copy linkLink copied to clipboard!
-
Master component, URI syntax:
master:namespace:delegateUri
Refer to the above link for usage and configuration details.
2.76.2. Maven coordinates Copy linkLink copied to clipboard!
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-master</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-master</artifactId>
</dependency>
2.76.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
This extension can be used in conjunction with extensions below:
2.77. Micrometer Copy linkLink copied to clipboard!
Collect various metrics directly from Camel routes using the Micrometer library.
2.77.1. What’s inside Copy linkLink copied to clipboard!
-
Micrometer component, URI syntax:
micrometer:metricsType:metricsName
Refer to the above link for usage and configuration details.
2.77.2. Maven coordinates Copy linkLink copied to clipboard!
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-micrometer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-micrometer</artifactId>
</dependency>
2.77.3. Usage Copy linkLink copied to clipboard!
This extension leverages Quarkus Micrometer. Quarkus supports a variety of Micrometer metric registry implementations.
Your application should declare the following dependency or one of the dependencies listed in the quarkiverse documentation, depending on the monitoring solution you want to work with.
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
</dependency>
If no dependency is declared, the Micrometer extension creates a SimpleMeterRegistry instance, suitable mainly for testing.
2.77.4. Camel Quarkus limitations Copy linkLink copied to clipboard!
2.77.4.1. Exposing Micrometer statistics in JMX Copy linkLink copied to clipboard!
Exposing Micrometer statistics in JMX is not available in native mode as quarkus-micrometer-registry-jmx does not have native support at present.
2.77.4.2. Decrement header for Counter is ignored by Prometheus Copy linkLink copied to clipboard!
Prometheus backend ignores negative values during increment of Counter metrics.
2.77.4.3. Exposing statistics in JMX Copy linkLink copied to clipboard!
In {project-name}, registering a JmxMeterRegistry is simplified. Add a dependency for io.quarkiverse.micrometer.registry:quarkus-micrometer-registry-jmx and a JmxMeterRegistry will automatically get created for you.
2.77.5. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
Set whether to enable the MicrometerRoutePolicyFactory for capturing metrics on route processing times. |
|
|
|
Set whether to enable the MicrometerMessageHistoryFactory 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 MicrometerExchangeEventNotifier for capturing metrics on exchange processing times. |
|
|
|
Set whether to enable the MicrometerRouteEventNotifier for capturing metrics on the total number of routes and total number of routes running. |
|
|
|
Set whether to gather performance information about Camel Thread Pools by injecting an InstrumentedThreadPoolFactory. |
|
|
|
Controls the naming style to use for metrics. The available values are |
|
|
|
Sets the level of metrics to capture. The available values are |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.78. Microprofile Fault Tolerance Copy linkLink copied to clipboard!
Circuit Breaker EIP using Microprofile Fault Tolerance
2.78.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.78.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
</dependency>
2.79. MicroProfile Health Copy linkLink copied to clipboard!
Expose Camel health checks via MicroProfile Health
2.79.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.79.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-health</artifactId>
</dependency>
2.79.3. Usage Copy linkLink copied to clipboard!
You can register health checks for your applications with the Camel health check API.
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.79.3.1. Provided health checks Copy linkLink copied to clipboard!
Some checks are automatically registered for your application.
2.79.3.1.1. Camel Context Health Copy linkLink copied to clipboard!
Inspects the Camel Context status and causes the health check status to be DOWN if the status is anything other than 'Started'.
2.79.3.1.2. Camel Route Health Copy linkLink copied to clipboard!
Inspects the status of each route and causes the health check status to be DOWN if any route status is not 'Started'.
2.79.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| 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.80. Minio Copy linkLink copied to clipboard!
Store and retrieve objects from Minio Storage Service using Minio SDK.
2.80.1. What’s inside Copy linkLink copied to clipboard!
-
Minio component, URI syntax:
minio:bucketName
Refer to the above link for usage and configuration details.
2.80.2. Maven coordinates Copy linkLink copied to clipboard!
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-minio</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-minio</artifactId>
</dependency>
2.80.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
Depending on Minio configuration, this extension may require SSL encryption on its connections. In such cases, you will need to add quarkus.ssl.native=true to your application.properties. See also Quarkus native SSL guide and Native mode section of Camel Quarkus user guide.
There are two different configuration approaches:
- Minio client can be defined via quarkus properties leveraging the Quarkiverse Minio (see documentation). Camel will autowire client into the Minio component. This configuration allows definition of only one minio client, therefore it isn’t possible to define several different minio endpoints, which run together.
- Provide client/clients for camel registry (e.g. CDI producer/bean) and reference them from endpoint.
minio:foo?minioClient=#minioClient
minio:foo?minioClient=#minioClient
2.81. MLLP Copy linkLink copied to clipboard!
Communicate with external systems using the MLLP protocol.
2.81.1. What’s inside Copy linkLink copied to clipboard!
-
MLLP component, URI syntax:
mllp:hostname:port
Refer to the above link for usage and configuration details.
2.81.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mllp</artifactId>
</dependency>
2.81.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
-
Check the Character encodings section of the Native mode guide if you wish to use the
defaultCharsetcomponent option.
2.82. Mock Copy linkLink copied to clipboard!
Test routes and mediation rules using mocks.
2.82.1. What’s inside Copy linkLink copied to clipboard!
-
Mock component, URI syntax:
mock:name
Refer to the above link for usage and configuration details.
2.82.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mock</artifactId>
</dependency>
2.82.3. Usage Copy linkLink copied to clipboard!
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:
Route used for the example test:
2.82.4. Camel Quarkus limitations Copy linkLink copied to clipboard!
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.83. MongoDB Copy linkLink copied to clipboard!
Perform operations on MongoDB documents and collections.
2.83.1. What’s inside Copy linkLink copied to clipboard!
-
MongoDB component, URI syntax:
mongodb:connectionBean
Refer to the above link for usage and configuration details.
2.83.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mongodb</artifactId>
</dependency>
2.83.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
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")
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/
//application.properties
quarkus.mongodb.mongoClient1.connection-string = mongodb://root:example@localhost:27017/
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.84. MyBatis Copy linkLink copied to clipboard!
Performs a query, poll, insert, update or delete in a relational database using MyBatis.
2.84.1. What’s inside Copy linkLink copied to clipboard!
-
MyBatis component, URI syntax:
mybatis:statement -
MyBatis Bean component, URI syntax:
mybatis-bean:beanName:methodName
Refer to the above links for usage and configuration details.
2.84.2. Maven coordinates Copy linkLink copied to clipboard!
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-mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mybatis</artifactId>
</dependency>
2.84.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
Refer to Quarkus MyBatis for configuration. It must enable the following options
quarkus.mybatis.xmlconfig.enable=true quarkus.mybatis.xmlconfig.path=SqlMapConfig.xml
quarkus.mybatis.xmlconfig.enable=true
quarkus.mybatis.xmlconfig.path=SqlMapConfig.xml
quarkus.mybatis.xmlconfig.path must be the same with configurationUri param in the mybatis endpoint.
2.85. Netty HTTP Copy linkLink copied to clipboard!
The Netty HTTP extension provides HTTP transport on top of the Netty extension.
2.85.1. What’s inside Copy linkLink copied to clipboard!
-
Netty HTTP component, URI syntax:
netty-http:protocol://host:port/path
Refer to the above link for usage and configuration details.
2.85.2. Maven coordinates Copy linkLink copied to clipboard!
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-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-netty-http</artifactId>
</dependency>
2.85.3. transferException option in native mode Copy linkLink copied to clipboard!
To use the transferException option in native mode, you must enable support for object serialization. Refer to the native mode user guide for more information.
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)
@RegisterForReflection(targets = { IllegalStateException.class, MyCustomException.class }, serialization = true)
2.85.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
- Check the Character encodings section of the Native mode guide if you expect your application to send or receive requests using non-default encodings.
2.86. Netty Copy linkLink copied to clipboard!
Socket level networking using TCP or UDP with Netty 4.x.
2.86.1. What’s inside Copy linkLink copied to clipboard!
-
Netty component, URI syntax:
netty:protocol://host:port
Refer to the above link for usage and configuration details.
2.86.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-netty</artifactId>
</dependency>
2.87. OpenAPI Java Copy linkLink copied to clipboard!
Expose OpenAPI resources defined in Camel REST DSL
2.87.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.87.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-openapi-java</artifactId>
</dependency>
2.87.3. Usage Copy linkLink copied to clipboard!
You can use this extension to expose REST DSL services to Quarkus OpenAPI. With quarkus-smallrye-openapi, you can access them by /q/openapi?format=json.
Refer to the Quarkus OpenAPI guide for further information.
This is an experimental feature. You can enable it by
quarkus.camel.openapi.expose.enabled=true
quarkus.camel.openapi.expose.enabled=true
It’s the user’s responsibility to use @RegisterForReflection to register all model classes for reflection.
It doesn’t support the rest services used in org.apache.camel.builder.LambdaRouteBuilder right now. Also, it can not use CDI injection in the RouteBuilder configure() since we get the rest definitions at build time while CDI is unavailable.
2.87.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
Expose the Camel REST DSL services to quarkus openapi at build time if 'quarkus.smallrye-openapi' is available. |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.88. OpenTelemetry Copy linkLink copied to clipboard!
Distributed tracing using OpenTelemetry
2.88.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.88.2. Maven coordinates Copy linkLink copied to clipboard!
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-opentelemetry</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-opentelemetry</artifactId>
</dependency>
2.88.3. Usage Copy linkLink copied to clipboard!
The extension automatically creates a Camel OpenTelemetryTracer and binds it to the Camel registry.
In order to send the captured traces to a tracing system, you need to configure some properties within application.properties like those below.
# Identifier for the origin of spans created by the application quarkus.application.name=my-camel-application # OTLP exporter endpoint quarkus.opentelemetry.tracer.exporter.otlp.endpoint=http://localhost:4317
# Identifier for the origin of spans created by the application
quarkus.application.name=my-camel-application
# OTLP exporter endpoint
quarkus.opentelemetry.tracer.exporter.otlp.endpoint=http://localhost:4317
Refer to the Quarkus OpenTelemetry guide for a full list of configuration options.
Route endpoints can be excluded from tracing by configuring a property named quarkus.camel.opentelemetry.exclude-patterns in application.properties. For example:
# Exclude all direct & netty-http endpoints from tracing quarkus.camel.opentelemetry.exclude-patterns=direct:*,netty-http:*
# Exclude all direct & netty-http endpoints from tracing
quarkus.camel.opentelemetry.exclude-patterns=direct:*,netty-http:*
2.88.3.1. Exporters Copy linkLink copied to clipboard!
Quarkus OpenTelemetry defaults to the standard OTLP exporter defined in OpenTelemetry. Additional exporters will be available in the Quarkiverse quarkus-opentelemetry-exporter project.
2.88.3.2. Tracing CDI bean method execution Copy linkLink copied to clipboard!
When instrumenting the execution of CDI bean methods from Camel routes, you should annotate such methods with io.opentelemetry.extension.annotations.WithSpan. Methods annotated with @WithSpan will create a new Span and establish any required relationships with the current Trace context.
For example, to instrument a CDI bean from a Camel route, first ensure the appropriate methods are annotated with @WithTrace.
Next, use the bean in your Camel route.
To ensure that the sequence of recorded spans is correct, you must use the full to("bean:") endpoint URI and not the shortened .bean() EIP DSL method.
There is more information about CDI instrumentation in the Quarkus OpenTelemetry guide.
2.88.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
Sets whether header names need to be encoded. Can be useful in situations where OpenTelemetry propagators potentially set header name values in formats that are not compatible with the target system. E.g for JMS where the specification mandates header names are valid Java identifiers. |
|
|
|
Sets whether to disable tracing for endpoint URIs or Processor ids that match the given comma separated patterns. The pattern can take the following forms: 1. An exact match on the endpoint URI. E.g platform-http:/some/path 2. A wildcard match. E.g platform-http:* 3. A regular expression matching the endpoint URI. E.g platform-http:/prefix/.* |
| |
|
Sets whether to create new OpenTelemetry spans for each Camel Processor. Use the excludePatterns property to filter out Processors. |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.89. Paho MQTT5 Copy linkLink copied to clipboard!
Communicate with MQTT message brokers using Eclipse Paho MQTT v5 Client.
2.89.1. What’s inside Copy linkLink copied to clipboard!
-
Paho MQTT 5 component, URI syntax:
paho-mqtt5:topic
Refer to the above link for usage and configuration details.
2.89.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-paho-mqtt5</artifactId>
</dependency>
2.90. Paho Copy linkLink copied to clipboard!
Communicate with MQTT message brokers using Eclipse Paho MQTT Client.
2.90.1. What’s inside Copy linkLink copied to clipboard!
-
Paho component, URI syntax:
paho:topic
Refer to the above link for usage and configuration details.
2.90.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-paho</artifactId>
</dependency>
2.91. Platform HTTP Copy linkLink copied to clipboard!
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.91.1. What’s inside Copy linkLink copied to clipboard!
-
Platform HTTP component, URI syntax:
platform-http:path
Refer to the above link for usage and configuration details.
2.91.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-platform-http</artifactId>
</dependency>
2.91.3. Usage Copy linkLink copied to clipboard!
2.91.3.1. Basic Usage Copy linkLink copied to clipboard!
Serve all HTTP methods on the /hello endpoint:
from("platform-http:/hello").setBody(simple("Hello ${header.name}"));
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}"));
from("platform-http:/hello?httpMethodRestrict=GET").setBody(simple("Hello ${header.name}"));
2.91.3.2. Using platform-http via Camel REST DSL Copy linkLink copied to clipboard!
To be able to use Camel REST DSL with the platform-http component, add camel-quarkus-rest to your pom.xml:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest</artifactId>
</dependency>
Then you can use the Camel REST DSL:
2.91.3.3. Handling multipart/form-data file uploads Copy linkLink copied to clipboard!
You can restrict the uploads to certain file extensions by white listing them:
2.91.3.4. Securing platform-http endpoints Copy linkLink copied to clipboard!
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:
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.91.3.5. Implementing a reverse proxy Copy linkLink copied to clipboard!
Platform HTTP component can act as a reverse proxy, in that case Exchange.HTTP_URI, Exchange.HTTP_HOST headers are populated from the absolute URL received on the request line of the HTTP request.
Here’s an example of a HTTP proxy that simply redirects the Exchange to the origin server.
from("platform-http:proxy")
.toD("http://"
+ "${headers." + Exchange.HTTP_HOST + "}");
from("platform-http:proxy")
.toD("http://"
+ "${headers." + Exchange.HTTP_HOST + "}");
2.91.3.6. Error handling Copy linkLink copied to clipboard!
If you need to customize the reponse returned to the client when exceptions are thrown from your routes, then you can use Camel error handling constucts like doTry, doCatch and onException.
For example, to configure a global exception handler in response to a specific Exception type being thrown.
You can implement more fine-grained error handling by hooking into the Vert.x Web router initialization with a CDI observer.
Note that care should be taken when modifying the router configuration when extensions such as RestEASY are present, since they may register their own error handling logic.
2.91.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.91.4.1. Platform HTTP server configuration Copy linkLink copied to clipboard!
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.91.4.2. Character encodings Copy linkLink copied to clipboard!
Check the Character encodings section of the Native mode guide if you expect your application to send or receive requests using non-default encodings.
2.92. Quartz Copy linkLink copied to clipboard!
Schedule sending of messages using the Quartz 2.x scheduler.
2.92.1. What’s inside Copy linkLink copied to clipboard!
-
Quartz component, URI syntax:
quartz:groupName/triggerName
Refer to the above link for usage and configuration details.
2.92.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-quartz</artifactId>
</dependency>
2.92.3. Usage Copy linkLink copied to clipboard!
2.92.3.1. Clustering Copy linkLink copied to clipboard!
Support for Quartz clustering is provided by the Quarkus Quartz extension. The following steps outline how to configure Quarkus Quartz for use with Camel.
Enable Quartz clustered mode and configure a
DataSourceas a persistence Quartz job store. An example configuration is as follows.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the correct JDBC driver extension to your application that corresponds to the value of
quarkus.datasource.db-kind. In the above examplepostgresqlis used, therefore the following JDBC dependency would be required. Adjust as necessary for your needs. Agroal is also required forDataSourcesupport.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Quarkus Flyway can automatically create the necessary Quartz database tables for you. Add
quarkus-flywayto your application (optional).<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-flyway</artifactId> </dependency><dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-flyway</artifactId> </dependency>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Also add a Quartz database creation script for your chosen database kind. The Quartz project provides ready made scripts that can be copied from here. Add the SQL script to
src/main/resources/db/migration/V1.0.0__QuarkusQuartz.sql. Quarkus Flyway will detect it on startup and will proceed to create the Quartz database tables.Configure the Camel Quartz component to use the Quarkus Quartz scheduler.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Further customization of the Quartz scheduler can be done via various configuration properties. Refer to to the Quarkus Quartz Configuration guide for more information.
2.93. Qute Copy linkLink copied to clipboard!
Transform messages using Quarkus Qute templating engine
2.93.1. Maven coordinates Copy linkLink copied to clipboard!
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-qute</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-qute</artifactId>
</dependency>
2.93.2. Usage Copy linkLink copied to clipboard!
For more information about Qute, Refer to the Quarkus Qute documentation.
2.93.3. Camel Quarkus limitations Copy linkLink copied to clipboard!
2.93.4. allowContextMapAll option in native mode Copy linkLink copied to clipboard!
The allowContextMapAll option is not supported in native mode as it requires reflective access to security sensitive camel core classes such as CamelContext & Exchange. This is considered a security risk and thus access to the feature is not provided by default.
2.93.5. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
By default, all files located in the src/main/resources/templates directory and its subdirectories are registered as templates. Templates are validated during startup and watched for changes in the development mode.
2.94. Ref Copy linkLink copied to clipboard!
Route messages to an endpoint looked up dynamically by name in the Camel Registry.
2.94.1. What’s inside Copy linkLink copied to clipboard!
-
Ref component, URI syntax:
ref:name
Refer to the above link for usage and configuration details.
2.94.2. Maven coordinates Copy linkLink copied to clipboard!
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-ref</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-ref</artifactId>
</dependency>
2.94.3. Usage Copy linkLink copied to clipboard!
CDI producer methods can be harnessed to bind endpoints to the Camel registry, so that they can be resolved using the ref URI scheme in Camel routes.
For example, to produce endpoint beans:
Use ref: to refer to the names of the CDI beans that were bound to the Camel registry:
2.95. REST OpenApi Copy linkLink copied to clipboard!
To call REST services using OpenAPI specification as contract.
2.95.1. What’s inside Copy linkLink copied to clipboard!
-
REST OpenApi component, URI syntax:
rest-openapi:specificationUri#operationId
Refer to the above link for usage and configuration details.
2.95.2. Maven coordinates Copy linkLink copied to clipboard!
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-openapi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest-openapi</artifactId>
</dependency>
2.95.3. Usage Copy linkLink copied to clipboard!
2.95.3.1. Required Dependencies Copy linkLink copied to clipboard!
A RestProducerFactory implementation must be available when using the rest-openapi extension. The currently known extensions are:
- camel-quarkus-http
- camel-quarkus-netty-http
Maven users will need to add one of these dependencies to their pom.xml, for example:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-http</artifactId>
</dependency>
Depending on which mechanism is used to load the OpenApi specification, additional dependencies may be required. When using the file resource locator, the org.apache.camel.quarkus:camel-quarkus-file extension must be added as a project dependency. When using ref or bean to load the specification, not only must the org.apache.camel.quarkus:camel-quarkus-bean dependency be added, but the bean itself must be annotated with @RegisterForReflection.
When using the classpath resource locator with native code, the path to the OpenAPI specification must be specified in the quarkus.native.resources.includes property of the application.properties file. For example:
quarkus.native.resources.includes=openapi.json
quarkus.native.resources.includes=openapi.json
2.95.3.2. Contract First Development Copy linkLink copied to clipboard!
The model classes generation has been integrated with the quarkus-maven-plugin. So there’s no need to use the swagger-codegen-maven-plugin, instead put your contract files in src/main/openapi with a .json suffix. And add the generate-code goal to the quarkus-maven-plugin like:
It requires a specific package name for the model classes by using the quarkus.camel.openapi.codegen.model-package property of the application.properties file. For example:
quarkus.camel.openapi.codegen.model-package=org.acme
quarkus.camel.openapi.codegen.model-package=org.acme
This package name should be added in camel.rest.bindingPackageScan as well.
The contract files in src/main/openapi needs to be added in the classpath since they could be used in Camel Rest DSL. So you can add src/main/openapi in pom.xml
When running in the native mode, the contract files must be specified the quarkus.native.resources.include like
quarkus.native.resources.includes=contract.json
quarkus.native.resources.includes=contract.json
2.95.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
If |
|
|
|
The package to use for generated model classes. |
|
|
|
A comma separated list of models to generate. All models is the default. |
| |
|
If |
|
|
|
If |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.96. Rest Copy linkLink copied to clipboard!
Expose REST services and their OpenAPI Specification or call external REST services.
2.96.1. What’s inside Copy linkLink copied to clipboard!
-
REST component, URI syntax:
rest:method:path:uriTemplate -
REST API component, URI syntax:
rest-api:path
Refer to the above links for usage and configuration details.
2.96.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest</artifactId>
</dependency>
2.96.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
This extension depends on the Platform HTTP extension and configures it as the component that provides the REST transport.
2.96.3.1. Path parameters containing special characters with platform-http Copy linkLink copied to clipboard!
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.
There is some more background to this in the Vert.x Web documentation.
2.96.3.2. Configuring alternate REST transport providers Copy linkLink copied to clipboard!
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:
2.97. Salesforce Copy linkLink copied to clipboard!
Communicate with Salesforce using Java DTOs.
2.97.1. What’s inside Copy linkLink copied to clipboard!
-
Salesforce component, URI syntax:
salesforce:operationName:topicName
Refer to the above link for usage and configuration details.
2.97.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-salesforce</artifactId>
</dependency>
2.97.3. Usage Copy linkLink copied to clipboard!
2.97.3.1. Generating Salesforce DTOs with the salesforce-maven-plugin Copy linkLink copied to clipboard!
iinclude::camel-quarkus-extensions/maven-plugin-unsupported.adoc[]
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.
2.97.3.2. Native mode support for Pub / Sub API with POJO pubSubDeserializeType Copy linkLink copied to clipboard!
When using the Camel Salesforce Pub / Sub API and pubSubDeserializeType is configured as POJO, you must register any classes configured on the pubSubPojoClass option for reflection.
For example, given the following route.
from("salesforce:pubSubSubscribe:/event/TestEvent__e?pubSubDeserializeType=POJO&pubSubPojoClass=org.foo.TestEvent")
.log("Received Salesforce POJO topic message: ${body}");
from("salesforce:pubSubSubscribe:/event/TestEvent__e?pubSubDeserializeType=POJO&pubSubPojoClass=org.foo.TestEvent")
.log("Received Salesforce POJO topic message: ${body}");
Class org.foo.TestEvent would need to be registered for reflection.
Refer to the Native mode user guide for more information.
2.97.4. SSL in native mode Copy linkLink copied to clipboard!
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.98. Saga Copy linkLink copied to clipboard!
Execute custom actions within a route using the Saga EIP.
2.98.1. What’s inside Copy linkLink copied to clipboard!
-
Saga component, URI syntax:
saga:action
Refer to the above link for usage and configuration details.
2.98.2. Maven coordinates Copy linkLink copied to clipboard!
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-saga</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-saga</artifactId>
</dependency>
2.99. SAP Copy linkLink copied to clipboard!
Provides SAP Camel Component
2.99.1. Maven coordinates Copy linkLink copied to clipboard!
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-sap</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-sap</artifactId>
</dependency>
2.99.2. Camel Quarkus limitations Copy linkLink copied to clipboard!
The SAP extension does not support the packaging type uber-jar which causes the application to throw a runtime exception similar to this:
Caused by: java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.ExceptionInInitializerError: Illegal JCo archive "sap-1.0.0-SNAPSHOT-runner.jar". It is not allowed to rename or repackage the original archive "sapjco3.jar".
Caused by: java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.ExceptionInInitializerError: Illegal JCo archive "sap-1.0.0-SNAPSHOT-runner.jar". It is not allowed to rename or repackage the original archive "sapjco3.jar".
2.100. XQuery Copy linkLink copied to clipboard!
Query and/or transform XML payloads using XQuery and Saxon.
2.100.1. What’s inside Copy linkLink copied to clipboard!
-
XQuery component, URI syntax:
xquery:resourceUri - XQuery language
Refer to the above links for usage and configuration details.
2.100.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-saxon</artifactId>
</dependency>
2.100.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
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");
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
quarkus.native.resources.includes = *.txt
More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.
2.101. AWS Secrets Manager Copy linkLink copied to clipboard!
Manage AWS Secrets Manager services using AWS SDK version 2.x.
2.101.1. What’s inside Copy linkLink copied to clipboard!
-
AWS Secrets Manager component, URI syntax:
aws-secrets-manager:label
Refer to the above link for usage and configuration details.
2.101.2. Maven coordinates Copy linkLink copied to clipboard!
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws-secrets-manager</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws-secrets-manager</artifactId>
</dependency>
2.101.3. AWS Secrets Manager Limitation in Camel 4.8 Copy linkLink copied to clipboard!
With Camel 4.8, the camel context reload is not triggered by executing updateSecret via Camel.
If you want to use the AWS Secrets Manager feature Automatic Camel context reloading on secret refresh, you must do one of the following:
update the secret via UI,
or
-
make an API call with operation
PutSecretValue.
2.102. Scheduler Copy linkLink copied to clipboard!
Generate messages in specified intervals using java.util.concurrent.ScheduledExecutorService.
2.102.1. What’s inside Copy linkLink copied to clipboard!
-
Scheduler component, URI syntax:
scheduler:name
Refer to the above link for usage and configuration details.
2.102.2. Maven coordinates Copy linkLink copied to clipboard!
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-scheduler</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-scheduler</artifactId>
</dependency>
2.103. SEDA Copy linkLink copied to clipboard!
Asynchronously call another endpoint from any Camel Context in the same JVM.
2.103.1. What’s inside Copy linkLink copied to clipboard!
-
SEDA component, URI syntax:
seda:name
Refer to the above link for usage and configuration details.
2.103.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-seda</artifactId>
</dependency>
2.104. Servlet Copy linkLink copied to clipboard!
Serve HTTP requests by a Servlet.
2.104.1. What’s inside Copy linkLink copied to clipboard!
-
Servlet component, URI syntax:
servlet:contextPath
Refer to the above link for usage and configuration details.
2.104.2. Maven coordinates Copy linkLink copied to clipboard!
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-servlet</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-servlet</artifactId>
</dependency>
2.104.3. Usage Copy linkLink copied to clipboard!
2.104.3.1. Configuring CamelHttpTransportServlet Copy linkLink copied to clipboard!
2.104.3.1.1. Minimal configuration Copy linkLink copied to clipboard!
The simplest way to configure CamelHttpTransportServlet is with configuration properties. The most minimal setup requires that you define one or more URL patterns for the Servlet with quarkus.camel.servlet.url-patterns.
For example with configuration like the following.
quarkus.camel.servlet.url-patterns = /*
quarkus.camel.servlet.url-patterns = /*
And a Camel route.
from("servlet://greet")
.setBody().constant("Hello World");
from("servlet://greet")
.setBody().constant("Hello World");
Produces the message Hello World.
2.104.3.1.2. Advanced configuration Copy linkLink copied to clipboard!
Servlet name
To give a specific name to the Servlet you can use the quarkus.camel.servlet.servlet-name configuration option.
quarkus.camel.servlet.servlet-name = My Custom Name
quarkus.camel.servlet.servlet-name = My Custom Name
Servlet class
You may use a custom Servlet class (E.g one that extends CamelHttpTransportServlet) in your Camel routes.
quarkus.camel.servlet.servlet-class = org.acme.MyCustomServlet
quarkus.camel.servlet.servlet-class = org.acme.MyCustomServlet
Multiple named Servlets
For more advanced use cases you can configure multiple 'named' Servlets.
from("servlet://greet?servletName=my-custom-a")
.setBody().constant("Hello World");
from("servlet://goodbye?servletName=my-custom-b")
.setBody().constant("Goodbye World");
from("servlet://greet?servletName=my-custom-a")
.setBody().constant("Hello World");
from("servlet://goodbye?servletName=my-custom-b")
.setBody().constant("Goodbye World");
Finer control of Servlet configuration
If you need more control of the Servlet configuration, for example to configure custom init parameters, then you can do this with a custom Servlet class through the jakarta.servlet.annotation.WebServlet annotation options.
Or you can configure the CamelHttpTransportServlet using a web-app descriptor placed into src/main/resources/META-INF/web.xml.
2.104.4. transferException option in native mode Copy linkLink copied to clipboard!
To use the transferException option in native mode, you must enable support for object serialization. Refer to the native mode user guide for more information.
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)
@RegisterForReflection(targets = { IllegalStateException.class, MyCustomException.class }, serialization = true)
2.104.5. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
A comma separated list of path patterns under which the CamelServlet should be accessible. Example path patterns: |
List of | |
|
A fully qualified name of a servlet class to serve paths that match |
|
|
|
A servletName as it would be defined in a |
|
|
|
Sets the loadOnStartup priority on the Servlet. A loadOnStartup is a value greater than or equal to zero, indicates to the container the initialization priority of the Servlet. If loadOnStartup is a negative integer, the Servlet is initialized lazily. |
|
|
|
Enables Camel to benefit from asynchronous Servlet support. |
|
|
|
When set to |
|
|
|
The name of a bean to configure an optional custom thread pool for handling Camel Servlet processing. |
| |
|
An absolute path to a directory on the file system to store files temporarily while the parts are processed or when the size of the file exceeds the specified file-size-threshold configuration value. |
|
|
|
The maximum size allowed in bytes for uploaded files. The default size (-1) allows an unlimited size. |
|
|
|
The maximum size allowed in bytes for a multipart/form-data request. The default size (-1) allows an unlimited size. |
|
|
|
The file size in bytes after which the file will be temporarily stored on disk. |
|
|
|
[[quarkus-camel-servlet—named-servlets—url-patterns]]
A comma separated list of path patterns under which the CamelServlet should be accessible. Example path patterns: |
List of | |
|
[[quarkus-camel-servlet—named-servlets—servlet-class]]
A fully qualified name of a servlet class to serve paths that match |
|
|
|
[[quarkus-camel-servlet—named-servlets—servlet-name]]
A servletName as it would be defined in a |
|
|
|
[[quarkus-camel-servlet—named-servlets—load-on-startup]] Sets the loadOnStartup priority on the Servlet. A loadOnStartup is a value greater than or equal to zero, indicates to the container the initialization priority of the Servlet. If loadOnStartup is a negative integer, the Servlet is initialized lazily. |
|
|
|
Enables Camel to benefit from asynchronous Servlet support. |
|
|
|
[[quarkus-camel-servlet—named-servlets—force-await]]
When set to |
|
|
|
[[quarkus-camel-servlet—named-servlets—executor-ref]] The name of a bean to configure an optional custom thread pool for handling Camel Servlet processing. |
| |
|
[[quarkus-camel-servlet—named-servlets—multipart-location]] An absolute path to a directory on the file system to store files temporarily while the parts are processed or when the size of the file exceeds the specified file-size-threshold configuration value. |
|
|
|
[[quarkus-camel-servlet—named-servlets—multipart-max-file-size]] The maximum size allowed in bytes for uploaded files. The default size (-1) allows an unlimited size. |
|
|
|
[[quarkus-camel-servlet—named-servlets—multipart-max-request-size]] The maximum size allowed in bytes for a multipart/form-data request. The default size (-1) allows an unlimited size. |
|
|
|
[[quarkus-camel-servlet—named-servlets—multipart-file-size-threshold]] The file size in bytes after which the file will be temporarily stored on disk. |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.105. Slack Copy linkLink copied to clipboard!
Send and receive messages to/from Slack.
2.105.1. What’s inside Copy linkLink copied to clipboard!
-
Slack component, URI syntax:
slack:channel
Refer to the above link for usage and configuration details.
2.105.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-slack</artifactId>
</dependency>
2.105.3. SSL in native mode Copy linkLink copied to clipboard!
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.106. SMB Copy linkLink copied to clipboard!
SMB component which consumes natively from file shares using the Server Message Block (SMB, also known as Common Internet File System - CIFS) protocol
2.106.1. What’s inside Copy linkLink copied to clipboard!
-
SMB component, URI syntax:
smb:hostname:port/shareName
Refer to the above link for usage and configuration details.
2.106.2. Maven coordinates Copy linkLink copied to clipboard!
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-smb</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-smb</artifactId>
</dependency>
2.107. SNMP Copy linkLink copied to clipboard!
Receive traps and poll SNMP (Simple Network Management Protocol) capable devices.
2.107.1. What’s inside Copy linkLink copied to clipboard!
-
SNMP component, URI syntax:
snmp:host:port
Refer to the above link for usage and configuration details.
2.107.2. Maven coordinates Copy linkLink copied to clipboard!
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-snmp</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-snmp</artifactId>
</dependency>
2.108. SOAP dataformat Copy linkLink copied to clipboard!
Marshal Java objects to SOAP messages and back.
2.108.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.108.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-soap</artifactId>
</dependency>
2.109. Splunk Copy linkLink copied to clipboard!
Publish or search for events in Splunk.
2.109.1. What’s inside Copy linkLink copied to clipboard!
-
Splunk component, URI syntax:
splunk:name
Refer to the above link for usage and configuration details.
2.109.2. Maven coordinates Copy linkLink copied to clipboard!
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-splunk</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-splunk</artifactId>
</dependency>
2.109.3. SSL in native mode Copy linkLink copied to clipboard!
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.110. Splunk HEC Copy linkLink copied to clipboard!
The splunk component allows to publish events in Splunk using the HTTP Event Collector.
2.110.1. What’s inside Copy linkLink copied to clipboard!
-
Splunk HEC component, URI syntax:
splunk-hec:splunkURL
Refer to the above link for usage and configuration details.
2.110.2. Maven coordinates Copy linkLink copied to clipboard!
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-splunk-hec</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-splunk-hec</artifactId>
</dependency>
2.110.3. SSL in native mode Copy linkLink copied to clipboard!
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.111. Spring RabbitMQ Copy linkLink copied to clipboard!
Send and receive messages from RabbitMQ using Spring RabbitMQ client.
2.111.1. What’s inside Copy linkLink copied to clipboard!
-
Spring RabbitMQ component, URI syntax:
spring-rabbitmq:exchangeName
Refer to the above link for usage and configuration details.
2.111.2. Maven coordinates Copy linkLink copied to clipboard!
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-spring-rabbitmq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-spring-rabbitmq</artifactId>
</dependency>
2.111.3. Camel Quarkus limitations Copy linkLink copied to clipboard!
You can use this extension without any special configuration in JVM mode.
In native mode you need to add
quarkus.native.additional-build-args = -H:+InlineBeforeAnalysis
quarkus.native.additional-build-args = -H:+InlineBeforeAnalysis
to your application.properties. This is to allow inlining of some static methods that would otherwise cause build failures (see this GraalVM issue).
2.112. SQL Copy linkLink copied to clipboard!
Perform SQL queries.
2.112.1. What’s inside Copy linkLink copied to clipboard!
-
SQL component, URI syntax:
sql:query -
SQL Stored Procedure component, URI syntax:
sql-stored:template
Refer to the above links for usage and configuration details.
2.112.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-sql</artifactId>
</dependency>
2.112.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.112.3.1. Configuring a DataSource Copy linkLink copied to clipboard!
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
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.112.3.1.1. Zero configuration with Quarkus Dev Services Copy linkLink copied to clipboard!
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.112.3.2. SQL scripts Copy linkLink copied to clipboard!
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
quarkus.native.resources.includes = queries.sql, sql/*.sql
2.112.3.3. SQL aggregation repository in native mode Copy linkLink copied to clipboard!
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.113. Telegram Copy linkLink copied to clipboard!
Send and receive messages using the Telegram Bot API.
2.113.1. What’s inside Copy linkLink copied to clipboard!
-
Telegram component, URI syntax:
telegram:type
Refer to the above link for usage and configuration details.
2.113.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-telegram</artifactId>
</dependency>
2.113.3. Usage Copy linkLink copied to clipboard!
2.113.4. Webhook Mode Copy linkLink copied to clipboard!
The Telegram extension supports usage in the webhook mode.
In order to enable webhook mode, users need first to add a REST implementation to their application. Maven users, for example, can add camel-quarkus-rest extension to their pom.xml file:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest</artifactId>
</dependency>
2.113.4.1. Webhook Copy linkLink copied to clipboard!
In this release of Red Hat build of Apache Camel for Quarkus, webhook mode is not supported.
2.113.5. SSL in native mode Copy linkLink copied to clipboard!
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.114. Timer Copy linkLink copied to clipboard!
Generate messages in specified intervals using java.util.Timer.
2.114.1. What’s inside Copy linkLink copied to clipboard!
-
Timer component, URI syntax:
timer:timerName
Refer to the above link for usage and configuration details.
2.114.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-timer</artifactId>
</dependency>
2.115. Validator Copy linkLink copied to clipboard!
Validate the payload using XML Schema and JAXP Validation.
2.115.1. What’s inside Copy linkLink copied to clipboard!
-
Validator component, URI syntax:
validator:resourceUri
Refer to the above link for usage and configuration details.
2.115.2. Maven coordinates Copy linkLink copied to clipboard!
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-validator</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-validator</artifactId>
</dependency>
2.116. Velocity Copy linkLink copied to clipboard!
Transform messages using a Velocity template.
2.116.1. What’s inside Copy linkLink copied to clipboard!
-
Velocity component, URI syntax:
velocity:resourceUri
Refer to the above link for usage and configuration details.
2.116.2. Maven coordinates Copy linkLink copied to clipboard!
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-velocity</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-velocity</artifactId>
</dependency>
2.116.3. Usage Copy linkLink copied to clipboard!
2.116.3.1. Custom body as domain object in the native mode Copy linkLink copied to clipboard!
When using a custom object as message body and referencing its properties in the template in the native mode, all the classes need to be registered for reflection (see the documentation).
Example:
@RegisterForReflection
public interface CustomBody {
}
@RegisterForReflection
public interface CustomBody {
}
2.116.4. allowContextMapAll option in native mode Copy linkLink copied to clipboard!
The allowContextMapAll option is not supported in native mode as it requires reflective access to security sensitive camel core classes such as CamelContext & Exchange. This is considered a security risk and thus access to the feature is not provided by default.
2.116.5. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
This component typically loads Velocity templates from classpath. To make it work also in native mode, you need to explicitly embed the templates in the native executable by using the quarkus.native.resources.includes property.
For instance, the route below would load the Velocity template from a classpath resource named template/simple.vm:
from("direct:start").to("velocity://template/simple.vm");
from("direct:start").to("velocity://template/simple.vm");
To include this (an possibly other templates stored in .vm files in the template directory) in the native image, you would have to add something like the following to your application.properties file:
quarkus.native.resources.includes = template/*.vm
quarkus.native.resources.includes = template/*.vm
More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.
2.117. Vert.x HTTP Client Copy linkLink copied to clipboard!
Camel HTTP client support with Vert.x
2.117.1. What’s inside Copy linkLink copied to clipboard!
-
Vert.x HTTP Client component, URI syntax:
vertx-http:httpUri
Refer to the above link for usage and configuration details.
2.117.2. Maven coordinates Copy linkLink copied to clipboard!
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-vertx-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-vertx-http</artifactId>
</dependency>
2.117.3. transferException option in native mode Copy linkLink copied to clipboard!
To use the transferException option in native mode, you must enable support for object serialization. Refer to the native mode user guide for more information.
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)
@RegisterForReflection(targets = { IllegalStateException.class, MyCustomException.class }, serialization = true)
2.117.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.117.5. allowJavaSerializedObject option in native mode Copy linkLink copied to clipboard!
When using the allowJavaSerializedObject option in native mode, the support of serialization might need to be enabled. Please, refer to the native mode user guide for more information.
2.117.5.1. Character encodings Copy linkLink copied to clipboard!
Check the Character encodings section of the Native mode guide if the application is expected to send and receive requests using non-default encodings.
2.118. Vert.x WebSocket Copy linkLink copied to clipboard!
This extension enables you to create WebSocket endpoints to that act as either a WebSocket server, or as a client to connect an existing WebSocket .
It is built on top of the Eclipse Vert.x HTTP server provided by the quarkus-vertx-http extension.
2.118.1. What’s inside Copy linkLink copied to clipboard!
-
Vert.x WebSocket component, URI syntax:
vertx-websocket:host:port/path
Refer to the above link for usage and configuration details.
2.118.2. Maven coordinates Copy linkLink copied to clipboard!
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-vertx-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-vertx-websocket</artifactId>
</dependency>
2.118.3. Usage Copy linkLink copied to clipboard!
2.118.3.1. Vert.x WebSocket consumers Copy linkLink copied to clipboard!
When you create a Vert.x WebSocket consumer (E.g with from("vertx-websocket")), the host and port configuration in the URI are redundant since the WebSocket will always be hosted on the Quarkus HTTP server.
The configuration of the consumer can be simplified to only include the resource path of the WebSocket. For example.
from("vertx-websocket:/my-websocket-path")
.setBody().constant("Hello World");
from("vertx-websocket:/my-websocket-path")
.setBody().constant("Hello World");
While you do not need to explicitly configure the host/port on the vertx-websocket consumer. If you choose to, the host & port must exactly match the value of the Quarkus HTTP server configuration values for quarkus.http.host and quarkus.http.port. Otherwise an exception will be thrown at runtime.
2.118.3.2. Vert.x WebSocket producers Copy linkLink copied to clipboard!
Similar to above, if you want to produce messages to the internal Vert.x WebSocket consumer, then you can omit the host and port from the endpoint URI.
from("vertx-websocket:/my-websocket-path")
.log("Got body: ${body}");
from("direct:sendToWebSocket")
.log("vertx-websocket:/my-websocket-path");
from("vertx-websocket:/my-websocket-path")
.log("Got body: ${body}");
from("direct:sendToWebSocket")
.log("vertx-websocket:/my-websocket-path");
Or alternatively, you can refer to the full host & port configuration for the Quarkus HTTP server.
from("direct:sendToWebSocket")
.log("vertx-websocket:{{quarkus.http.host}}:{{quarkus.http.port}}/my-websocket-path");
from("direct:sendToWebSocket")
.log("vertx-websocket:{{quarkus.http.host}}:{{quarkus.http.port}}/my-websocket-path");
When producing messages to an external WebSocket server, then you must always provide the host name and port (if required).
2.118.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.118.4.1. Vert.x WebSocket server configuration Copy linkLink copied to clipboard!
Configuration of the Vert.x WebSocket server is managed by Quarkus. Refer to the Quarkus HTTP configuration guide for the full list of configuration options.
To configure SSL for the Vert.x WebSocket server, follow the secure connections with SSL guide. Note that configuring the server for SSL with SSLContextParameters is not currently supported.
2.118.4.2. Character encodings Copy linkLink copied to clipboard!
Check the Character encodings section of the Native mode guide if you expect your application to send or receive requests using non-default encodings.
2.119. XJ Copy linkLink copied to clipboard!
Transform JSON and XML message using a XSLT.
2.119.1. What’s inside Copy linkLink copied to clipboard!
-
XJ component, URI syntax:
xj:resourceUri
Refer to the above link for usage and configuration details.
2.119.2. Maven coordinates Copy linkLink copied to clipboard!
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-xj</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xj</artifactId>
</dependency>
2.120. XML IO DSL Copy linkLink copied to clipboard!
An XML stack for parsing XML route definitions
2.120.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.120.2. Maven coordinates Copy linkLink copied to clipboard!
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-xml-io-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-io-dsl</artifactId>
</dependency>
2.120.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
2.120.3.1. XML file encodings Copy linkLink copied to clipboard!
By default, some XML file encodings may not work out of the box in native mode. Please, check the Character encodings section to learn how to fix.
2.121. XML JAXP Copy linkLink copied to clipboard!
XML JAXP type converters and parsers
2.121.1. Maven coordinates Copy linkLink copied to clipboard!
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-xml-jaxp</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-jaxp</artifactId>
</dependency>
2.122. XPath Copy linkLink copied to clipboard!
Evaluates an XPath expression against an XML payload
2.122.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.122.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xpath</artifactId>
</dependency>
2.122.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
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");
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
quarkus.native.resources.includes = *.txt
More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.
2.123. XSLT Saxon Copy linkLink copied to clipboard!
Transform XML payloads using an XSLT template using Saxon.
2.123.1. What’s inside Copy linkLink copied to clipboard!
-
XSLT Saxon component, URI syntax:
xslt-saxon:resourceUri
Refer to the above link for usage and configuration details.
2.123.2. Maven coordinates Copy linkLink copied to clipboard!
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-xslt-saxon</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xslt-saxon</artifactId>
</dependency>
2.124. XSLT Copy linkLink copied to clipboard!
Transforms XML payload using an XSLT template.
2.124.1. What’s inside Copy linkLink copied to clipboard!
-
XSLT component, URI syntax:
xslt:resourceUri
Refer to the above link for usage and configuration details.
2.124.2. Maven coordinates Copy linkLink copied to clipboard!
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-xslt</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xslt</artifactId>
</dependency>
2.124.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
To optimize XSLT processing, the extension needs to know the locations of the XSLT templates at build time. The XSLT source URIs have to be passed via the quarkus.camel.xslt.sources property. Multiple URIs can be separated by comma.
quarkus.camel.xslt.sources = transform.xsl, classpath:path/to/my/file.xsl
quarkus.camel.xslt.sources = transform.xsl, classpath:path/to/my/file.xsl
Scheme-less URIs are interpreted as classpath: URIs.
Only classpath: URIs are supported on Quarkus native mode. file:, http: and other kinds of URIs can be used on JVM mode only.
<xsl:include> and <xsl:messaging> XSLT elements are also supported in JVM mode only right now.
If aggregate DSL is used, XsltSaxonAggregationStrategy has to be used such as
Also, it’s only supported on JVM mode.
2.124.3.1. Configuration Copy linkLink copied to clipboard!
TransformerFactory features can be configured using following property:
quarkus.camel.xslt.features."http\://javax.xml.XMLConstants/feature/secure-processing"=false
quarkus.camel.xslt.features."http\://javax.xml.XMLConstants/feature/secure-processing"=false
2.124.3.2. Extension functions support Copy linkLink copied to clipboard!
Xalan’s extension functions do work properly only when:
- Secure-processing is disabled
- Functions are defined in a separate jar
- Functions are augmented during native build phase. For example, they can be registered for reflection:
@RegisterForReflection(targets = { my.Functions.class })
public class FunctionsConfiguration {
}
@RegisterForReflection(targets = { my.Functions.class })
public class FunctionsConfiguration {
}
The content of the XSLT source URIs is parsed and compiled into Java classes at build time. These Java classes are the only source of XSLT information at runtime. The XSLT source files may not be included in the application archive at all.
| Configuration property | Type | Default |
|---|---|---|
|
A comma separated list of templates to compile. |
List of | |
|
The package name for the generated classes. |
|
|
|
[[quarkus-camel-xslt-features—features]] TransformerFactory features. |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
2.125. YAML DSL Copy linkLink copied to clipboard!
An YAML stack for parsing YAML route definitions
2.125.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.125.2. Maven coordinates Copy linkLink copied to clipboard!
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-yaml-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-yaml-dsl</artifactId>
</dependency>
2.125.3. Usage Copy linkLink copied to clipboard!
2.125.3.1. Native mode Copy linkLink copied to clipboard!
The following constructs when defined within Camel YAML DSL markup, require you to register classes for reflection. Refer to the Native mode guide for details.
2.125.3.1.1. Bean definitions Copy linkLink copied to clipboard!
The YAML DSL provides the capability to define beans as follows.
In this example, the GreetingBean class needs to be registered for reflection. This applies to any types that you refer to under the beans key in your YAML routes.
@RegisterForReflection
public class GreetingBean {
}
@RegisterForReflection
public class GreetingBean {
}
2.125.3.1.2. Exception handling Copy linkLink copied to clipboard!
Camel provides various methods of handling exceptions. Some of these require that any exception classes referenced in their DSL definitions are registered for reflection.
on-exception
@RegisterForReflection
public class MyHandledException {
}
@RegisterForReflection
public class MyHandledException {
}
throw-exception
@RegisterForReflection
public class ForcedException {
}
@RegisterForReflection
public class ForcedException {
}
do-catch
@RegisterForReflection(targets = FileNotFoundException.class)
public class MyClass {
}
@RegisterForReflection(targets = FileNotFoundException.class)
public class MyClass {
}
2.126. YAML IO Copy linkLink copied to clipboard!
Dump routes in YAML format
2.126.1. Maven coordinates Copy linkLink copied to clipboard!
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-yaml-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-yaml-io</artifactId>
</dependency>
2.126.2. Usage Copy linkLink copied to clipboard!
This an auxiliary extension that provides support for Camel route dumping in YAML.
For example, when the application is configured to dump routes on startup with the following configuration in application.properties.
camel.main.dump-routes = yaml
camel.main.dump-routes = yaml
2.127. Zip Deflate Compression Copy linkLink copied to clipboard!
Compress and decompress streams using java.util.zip.Deflater, java.util.zip.Inflater or java.util.zip.GZIPStream.
2.127.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above links for usage and configuration details.
2.127.2. Maven coordinates Copy linkLink copied to clipboard!
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-zip-deflater</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-zip-deflater</artifactId>
</dependency>
2.128. Zip File Copy linkLink copied to clipboard!
Compression and decompress streams using java.util.zip.ZipStream.
2.128.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
2.128.2. Maven coordinates Copy linkLink copied to clipboard!
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>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-zipfile</artifactId>
</dependency>
Chapter 3. Quarkus CXF overview Copy linkLink copied to clipboard!
This chapter provides information about Quarkus CXF extensions, CXF modules and CXF annotations supported by Quarkus CXF.
3.1. Quarkus CXF Copy linkLink copied to clipboard!
The following table shows the Quarkus CXF extensions. Click the extension names to learn more about how to configure and use them, and about any known limitations.
| Quarkus CXF extension | Support level | Since | Supported standards |
|---|---|---|---|
|
Quarkus CXF | Stable | 0.1.0 | |
|
Quarkus CXF Metrics Feature | Stable | 0.14.0 | |
|
Quarkus CXF OpenTelemetry | Stable | 2.7.0 | |
|
Quarkus CXF WS-Security | Stable | 0.14.0 | |
|
Quarkus CXF WS-ReliableMessaging | Stable | 1.5.3 | |
|
Quarkus CXF Security Token Service (STS) | Stable | 1.5.3 | |
|
Quarkus CXF HTTP Async Transport | Stable | 1.1.0 | |
|
Quarkus CXF XJC Plugins | Stable | 1.5.11 |
3.2. Supported CXF modules Copy linkLink copied to clipboard!
Here is a list of CXF modules supported by Quarkus CXF. You should typically not depend on these directly, but rather use some of the extensions listed above that brings the given CXF module as a transitive dependency.
3.2.1. Front ends Copy linkLink copied to clipboard!
Out of CXF front ends only the JAX-WS front end is fully supported by quarkus-cxf.
The Simple front end may work in JVM mode, but it is not tested properly. We advise not to use it.
3.2.2. Data Bindings Copy linkLink copied to clipboard!
Out of CXF Data Bindings only the following ones are supported:
3.2.3. Transports Copy linkLink copied to clipboard!
Out of CXF Transports only the following ones are supported:
-
quarkus-cxfimplements its own custom transport based on Quarkus and Vert.x for serving SOAP endpoints HTTP client via
quarkus-cxf, including-
Asynchronous Client HTTP Transport via
quarkus-cxf-rt-transports-http-hc5
3.2.4. Tools Copy linkLink copied to clipboard!
-
wsdl2Java- see the Generate the Model classes from WSDL section of User guide -
java2ws- see the Generate WSDL from Java section of User guide
3.2.5. Supported SOAP Bindings Copy linkLink copied to clipboard!
All CXF WSDL Bindings are supported. In order to switch to SOAP 1.2 or to add MTOM, set quarkus.cxf.[client|endpoint]."name".soap-binding to one of the following values:
| Binding | Property Value |
|---|---|
| SOAP 1.1 (default) |
|
| SOAP 1.2 |
|
| SOAP 1.1 with MTOM |
|
| SOAP 1.2 with MTOM |
|
3.3. Unsupported CXF modules Copy linkLink copied to clipboard!
Here is a list of CXF modules currently not supported by Quarkus CXF along with possible alternatives and/or reasons why the given module is not supported.
| CXF module | Alternative |
|---|---|
|
JAX-RS | |
| Use JAXB and JAX-WS | |
|
DOSGI | |
| JiBX | Use JAXB and JAX-WS |
|
Local transport | Use HTTP transport |
|
JMS transport | Use HTTP transport |
|
JBI | Deprecated in CXF use HTTP transport |
|
UDP transport | Use HTTP transport |
| Use HTTP transport | |
|
WebSocket transport | Use HTTP transport |
|
Clustering | |
|
CORBA | Use JAX-WS |
|
SDO databinding | |
| Deprecated in CXF | |
| Use JAX-WS | |
| Use HTTP transport | |
|
WS-Transfer runtime | |
|
Throttling | Use load balancer |
3.4. Supported CXF annotations Copy linkLink copied to clipboard!
Here is the status of CXF annotations on Quarkus. Unless stated otherwise, the support is available via io.quarkiverse.cxf:quarkus-cxf.
| Annotation | Status |
|---|---|
|
| Supported |
|
| Supported |
|
| Supported |
|
| Supported |
|
| Supported |
|
| Supported |
|
| Supported |
|
| Supported |
|
|
Only the default value |
|
| Supported |
|
| Supported |
|
|
Supported via |
|
| Supported |
|
| Supported |
|
| Supported |
|
| Supported |
|
| Supported |
Chapter 4. Quarkus CXF extensions reference Copy linkLink copied to clipboard!
This chapter provides reference information about Quarkus CXF extensions.
4.1. Quarkus CXF Copy linkLink copied to clipboard!
Core capabilities for implementing SOAP clients and JAX-WS services.
4.1.1. Maven coordinates Copy linkLink copied to clipboard!
Create a new project using quarkus-cxf on code.quarkus.redhat.com or add these coordinates to your existing project:
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf</artifactId>
</dependency>
4.1.2. Supported standards Copy linkLink copied to clipboard!
4.1.3. Usage Copy linkLink copied to clipboard!
There are several chapters in the User guide covering the usage of this extension:
- Your first SOAP Web service
- Your first SOAP Client
- Configuration
- Package for JVM and native
- Logging
- SSL
- Authentication and authorization
- Advanced SOAP client topics
- Running behind a reverse proxy
- Generate Java from WSDL
- Generate WSDL from Java
- Contract first and code first
- CXF Interceptors and Features
- JAX-WS Handlers
- JAX-WS Providers
- Examples
4.1.4. Configuration Copy linkLink copied to clipboard!
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
| Configuration property | Type | Default |
|---|---|---|
|
|
| |
|
If
Environment variable: | ||
|
List of | ||
|
A comma separated list of glob patterns for selecting WSDL files which should be processed with Examples:
File extensions
File extensions other than
There is no default value for this option, so
Specifying
Make sure that the file sets selected by
The files from
Environment variable: | ||
|
List of | ||
|
A comma separated list of path patterns for selecting WSDL files which should not be processed with
Environment variable: | ||
|
| ||
| A directory into which the generated files will be written, either absolute or relative to the current Maven or Gradle module directory.
The default value is build tool dependent: for Maven, it is typically Quarkus tooling is only able to set up the default value as a source folder for the given build tool. If you set this to a custom path it is up to you to make sure that your build tool recognizes the path a as source folder.
Also, if you choose a path outside
This will be passed as option
Environment variable: | ||
|
List of | ||
| A comma separated list of tokens; each token can be one of the following:
This will be passed as option
Environment variable: | ||
|
List of | ||
| A comma separated list of WSDL schema namespace URIs to ignore when generating Java code.
This will be passed as option
Environment variable: | ||
|
| ||
| The WSDL service name to use for the generated code.
This will be passed as option
Environment variable: | ||
|
List of | ||
| A list of paths pointing at JAXWS or JAXB binding files or XMLBeans context files. The path to be either absolute or relative to the current Maven or Gradle module.
This will be passed as option
Environment variable: | ||
|
|
| |
|
If
This will be passed as option
Environment variable: | ||
|
| ||
|
Specifies the value of the
This will be passed as option
Environment variable: | ||
|
List of | ||
|
A comma separated list of XJC extensions to enable. The following extensions are available through
These values correspond to
Environment variable: | ||
|
|
| |
|
A fully qualified class name to use as a superclass for fault beans generated from
This will be passed as option
Environment variable: | ||
|
List of | ||
|
A comma separated list of SEI methods for which asynchronous sibling methods should be generated; similar to
This will be passed as option
Environment variable: | ||
|
List of | ||
|
A comma separated list of SEI methods for which wrapper style sibling methods should be generated; similar to
This will be passed as option
Environment variable: | ||
|
List of | ||
|
A comma separated list of SEI methods for which
This will be passed as option
Environment variable: | ||
|
List of | ||
|
A comma separated list of additional command line parameters that should be passed to CXF
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
List of | ||
|
A comma separated list of glob patterns for selecting class names which should be processed with
The universe of class names to which Examples:
Let’s say that the application contains two classes annotated with Then
There is no default value for this option, so
Specifying
Make sure that the class names selected by
If you would like to include the generated WSDL files in native image, you need to add them yourself using
Environment variable: | ||
|
List of | ||
|
A comma separated list of glob patterns for selecting java class names which should not be processed with
Environment variable: | ||
|
List of | ||
|
A comma separated list of additional command line parameters that should be passed to CXF Supported options Currently, only options related to generation of WSDL from Java are supported.
Environment variable: | ||
|
|
| |
| A template for the names of generated WSDL files. There are 4 place holders, which can be used in the template:
Environment variable: | ||
|
|
| |
| The default path for CXF resources. Earlier versions
The default value before Quarkus CXF version 2.0.0 was
Environment variable: | ||
|
|
| |
| The size in bytes of the chunks of memory allocated when writing data. This is a very advanced setting that should only be set if you understand exactly how it affects the output IO operations of the application.
Environment variable: | ||
|
|
| |
| The size of the output stream response buffer in bytes. If a response is larger than this and no content-length is provided then the response will be chunked. Larger values may give slight performance increases for large responses, at the expense of more memory usage.
Environment variable: | ||
|
| ||
|
Select the
Environment variable: | ||
|
| ||
|
An URI base to use as a prefix of quarkus.cxf.decoupled-endpoint-base = https://api.example.com:${quarkus.http.ssl-port}${quarkus.cxf.path}
# or for plain HTTP
quarkus.cxf.decoupled-endpoint-base = http://api.example.com:${quarkus.http.port}${quarkus.cxf.path}
If you invoke your WS client from within a HTTP handler, you can leave this option unspecified and rather set it dynamically on the request context of your WS client using the
Environment variable: | ||
|
|
| |
|
Specifies whether the message logging will be enabled for clients, services, both or none. This setting can be overridden per client or service endpoint using
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
|
| |
|
A message length in bytes at which it is truncated in the log. This setting can be overridden per client or service endpoint using
Environment variable: | ||
|
|
| |
|
A message length in bytes at which it will be written to disk.
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
List of | ||
|
A comma separated list of additional binary media types to add to the default values in the
Environment variable: | ||
|
List of | ||
|
A comma separated list of additional binary media types to add to the default values in the
Environment variable: | ||
|
List of | ||
|
A comma separated list of additional binary media types to add to the default values in the
Environment variable: | ||
|
List of | ||
|
A comma separated list of XML elements containing sensitive information to be masked in the log. This setting can be overridden per client or service endpoint using
Environment variable: | ||
|
List of | ||
|
A comma separated list of protocol headers containing sensitive information to be masked in the log. This setting can be overridden per client or service endpoint using
Environment variable: | ||
|
|
List of | |
|
A comma separated list of glob patterns for selecting WSDL files which should be processed with Examples:
File extensions
File extensions other than
There is no default value for this option, so
Specifying
Make sure that the file sets selected by
The files from
Environment variable: | ||
|
|
List of | |
|
A comma separated list of path patterns for selecting WSDL files which should not be processed with
Environment variable: | ||
|
|
| |
| A directory into which the generated files will be written, either absolute or relative to the current Maven or Gradle module directory.
The default value is build tool dependent: for Maven, it is typically Quarkus tooling is only able to set up the default value as a source folder for the given build tool. If you set this to a custom path it is up to you to make sure that your build tool recognizes the path a as source folder.
Also, if you choose a path outside
This will be passed as option
Environment variable: | ||
|
|
List of | |
| A comma separated list of tokens; each token can be one of the following:
This will be passed as option
Environment variable: | ||
|
|
List of | |
| A comma separated list of WSDL schema namespace URIs to ignore when generating Java code.
This will be passed as option
Environment variable: | ||
|
|
| |
| The WSDL service name to use for the generated code.
This will be passed as option
Environment variable: | ||
|
|
List of | |
| A list of paths pointing at JAXWS or JAXB binding files or XMLBeans context files. The path to be either absolute or relative to the current Maven or Gradle module.
This will be passed as option
Environment variable: | ||
|
|
|
|
|
If
This will be passed as option
Environment variable: | ||
|
|
| |
|
Specifies the value of the
This will be passed as option
Environment variable: | ||
|
List of | ||
|
A comma separated list of XJC extensions to enable. The following extensions are available through
These values correspond to
Environment variable: | ||
|
|
|
|
|
A fully qualified class name to use as a superclass for fault beans generated from
This will be passed as option
Environment variable: | ||
|
|
List of | |
|
A comma separated list of SEI methods for which asynchronous sibling methods should be generated; similar to
This will be passed as option
Environment variable: | ||
|
|
List of | |
|
A comma separated list of SEI methods for which wrapper style sibling methods should be generated; similar to
This will be passed as option
Environment variable: | ||
|
|
List of | |
|
A comma separated list of SEI methods for which
This will be passed as option
Environment variable: | ||
|
|
List of | |
|
A comma separated list of additional command line parameters that should be passed to CXF
Environment variable: | ||
|
List of | ||
|
A comma separated list of glob patterns for selecting class names which should be processed with
The universe of class names to which Examples:
Let’s say that the application contains two classes annotated with Then
There is no default value for this option, so
Specifying
Make sure that the class names selected by
If you would like to include the generated WSDL files in native image, you need to add them yourself using
Environment variable: | ||
|
List of | ||
|
A comma separated list of glob patterns for selecting java class names which should not be processed with
Environment variable: | ||
|
|
List of | |
|
A comma separated list of additional command line parameters that should be passed to CXF Supported options Currently, only options related to generation of WSDL from Java are supported.
Environment variable: | ||
|
|
|
|
| A template for the names of generated WSDL files. There are 4 place holders, which can be used in the template:
Environment variable: | ||
|
| ||
| The client service interface class name
Environment variable: | ||
|
|
| |
|
Indicates whether this is an alternative proxy client configuration. If true, then this configuration is ignored when configuring a client without annotation
Environment variable: | ||
|
|
| |
|
If
Setting this to
Environment variable: | ||
|
| ||
| The service endpoint implementation class
Environment variable: | ||
|
| ||
| The service endpoint WSDL path
Environment variable: | ||
|
| ||
| The URL of the SOAP Binding, should be one of four values:
Environment variable: | ||
|
|
| |
| The published service endpoint URL
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
| ||
|
A message length in bytes at which it is truncated in the log. The default is given by
Environment variable: | ||
|
|
| |
|
A message length in bytes at which it will be written to disk.
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
|
List of | |
|
A comma separated list of additional binary media types to add to the default values in the
Environment variable: | ||
|
|
List of | |
|
A comma separated list of additional binary media types to add to the default values in the
Environment variable: | ||
|
|
List of | |
|
A comma separated list of additional binary media types to add to the default values in the
Environment variable: | ||
|
|
List of | |
|
A comma separated list of XML elements containing sensitive information to be masked in the log. The default is given by
Environment variable: | ||
|
|
List of | |
|
A comma separated list of protocol headers containing sensitive information to be masked in the log. The default is given by
Environment variable: | ||
|
List of | ||
| A comma-separated list of fully qualified CXF Feature class names or named CDI beans. Examples: quarkus.cxf.endpoint."/hello".features = org.apache.cxf.ext.logging.LoggingFeature quarkus.cxf.endpoint."/fruit".features = #myCustomLoggingFeature
In the second case, the
Environment variable: | ||
|
List of | ||
| The comma-separated list of Handler classes
Environment variable: | ||
|
List of | ||
| The comma-separated list of InInterceptor classes
Environment variable: | ||
|
List of | ||
| The comma-separated list of OutInterceptor classes
Environment variable: | ||
|
|
List of | |
| The comma-separated list of OutFaultInterceptor classes
Environment variable: | ||
|
List of | ||
| The comma-separated list of InFaultInterceptor classes
Environment variable: | ||
|
|
| |
|
Select for which messages XML Schema validation should be enabled. If not specified, no XML Schema validation will be enforced unless it is enabled by other means, such as
Environment variable: | ||
|
| ||
| A URL, resource path or local filesystem path pointing to a WSDL document to use when generating the service proxy of this client.
Environment variable: | ||
|
| ||
| The URL of the SOAP Binding, should be one of four values:
Environment variable: | ||
|
| ||
| The client endpoint URL
Environment variable: | ||
|
| ||
| The client endpoint namespace
Environment variable: | ||
|
| ||
| The client endpoint name
Environment variable: | ||
|
| ||
| The username for HTTP Basic authentication
Environment variable: | ||
|
| ||
| The password for HTTP Basic authentication
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
| ||
|
A message length in bytes at which it is truncated in the log. The default is given by
Environment variable: | ||
|
| ||
|
A message length in bytes at which it will be written to disk.
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
| ||
|
If
Environment variable: | ||
|
|
List of | |
|
A comma separated list of additional binary media types to add to the default values in the
Environment variable: | ||
|
|
List of | |
|
A comma separated list of additional binary media types to add to the default values in the
Environment variable: | ||
|
|
List of | |
|
A comma separated list of additional binary media types to add to the default values in the
Environment variable: | ||
|
|
List of | |
|
A comma separated list of XML elements containing sensitive information to be masked in the log. The default is given by
Environment variable: | ||
|
|
List of | |
|
A comma separated list of protocol headers containing sensitive information to be masked in the log. The default is given by
Environment variable: | ||
|
List of | ||
| A comma-separated list of fully qualified CXF Feature class names. Example: quarkus.cxf.endpoint."/my-endpoint".features = org.apache.cxf.ext.logging.LoggingFeature
Environment variable: | ||
|
List of | ||
| The comma-separated list of Handler classes
Environment variable: | ||
|
List of | ||
| The comma-separated list of InInterceptor classes
Environment variable: | ||
|
List of | ||
| The comma-separated list of OutInterceptor classes
Environment variable: | ||
|
List of | ||
| The comma-separated list of OutFaultInterceptor classes
Environment variable: | ||
|
List of | ||
| The comma-separated list of InFaultInterceptor classes
Environment variable: | ||
|
|
| |
| Specifies the amount of time, in milliseconds, that the consumer will attempt to establish a connection before it times out. 0 is infinite.
Environment variable: | ||
|
|
| |
| Specifies the amount of time, in milliseconds, that the consumer will wait for a response before it times out. 0 is infinite.
Environment variable: | ||
|
|
| |
| Specifies the amount of time, in milliseconds, used when requesting a connection from the connection manager(if appliable). 0 is infinite.
Environment variable: | ||
|
|
| |
| Specifies if the consumer will automatically follow a server issued redirection. (name is not part of standard)
Environment variable: | ||
|
|
| |
| Specifies the maximum amount of retransmits that are allowed for redirects. Retransmits for authorization is included in the retransmit count. Each redirect may cause another retransmit for a UNAUTHORIZED response code, ie. 401. Any negative number indicates unlimited retransmits, although, loop protection is provided. The default is unlimited. (name is not part of standard)
Environment variable: | ||
|
|
| |
| If true, the client is free to use chunking streams if it wants, but it is not required to use chunking streams. If false, the client must use regular, non-chunked requests in all cases.
Environment variable: | ||
|
|
| |
| If AllowChunking is true, this sets the threshold at which messages start getting chunked. Messages under this limit do not get chunked.
Environment variable: | ||
|
|
| |
| Specifies the chunk length for a HttpURLConnection. This value is used in java.net.HttpURLConnection.setChunkedStreamingMode(int chunklen). chunklen indicates the number of bytes to write in each chunk. If chunklen is less than or equal to zero, a default value will be used.
Environment variable: | ||
|
| ||
| Specifies the MIME types the client is prepared to handle (e.g., HTML, JPEG, GIF, etc.)
Environment variable: | ||
|
| ||
| Specifies the language the client desires (e.g., English, French, etc.)
Environment variable: | ||
|
| ||
| Specifies the encoding the client is prepared to handle (e.g., gzip)
Environment variable: | ||
|
| ||
| Specifies the content type of the stream being sent in a post request. (this should be text/xml for web services, or can be set to application/x-www-form-urlencoded if the client is sending form data).
Environment variable: | ||
|
| ||
| Specifies the Internet host and port number of the resource on which the request is being invoked. This is sent by default based upon the URL. Certain DNS scenarios or application designs may request you to set this, but typically it is not required.
Environment variable: | ||
|
|
| |
| The connection disposition. If close the connection to the server is closed after each request/response dialog. If Keep-Alive the client requests the server to keep the connection open, and if the server honors the keep alive request, the connection is reused. Many servers and proxies do not honor keep-alive requests.
Environment variable: | ||
|
| ||
| Most commonly used to specify no-cache, however the standard supports a dozen or so caching related directives for requests
Environment variable: | ||
|
|
| |
|
HTTP Version used for the connection. The default value
Some of these values might be unsupported by some
Environment variable: | ||
|
| ||
|
The value of the
Environment variable: | ||
|
| ||
|
An URI path (starting with
Environment variable: | ||
|
| ||
| Specifies the address of proxy server if one is used.
Environment variable: | ||
|
| ||
| Specifies the port number used by the proxy server.
Environment variable: | ||
|
| ||
| Specifies the list of hostnames that will not use the proxy configuration. Examples:
Environment variable: | ||
|
|
| |
| Specifies the type of the proxy server. Can be either HTTP or SOCKS.
Environment variable: | ||
|
| ||
| Username for the proxy authentication
Environment variable: | ||
|
| ||
| Password for the proxy authentication
Environment variable: | ||
|
| ||
|
Select the
Environment variable: | ||
|
| ||
| The key store location for this client. The resource is first looked up in the classpath, then in the file system.
Environment variable: | ||
|
| ||
| The key store password
Environment variable: | ||
|
|
| |
| The type of the key store.
Environment variable: | ||
|
| ||
| The key password.
Environment variable: | ||
|
| ||
| The trust store location for this client. The resource is first looked up in the classpath, then in the file system.
Environment variable: | ||
|
| ||
| The trust store password.
Environment variable: | ||
|
|
| |
| The type of the trust store.
Environment variable: | ||
|
| ||
| Can be one of the following:
Environment variable: | ||
|
|
| |
|
Select for which messages XML Schema validation should be enabled. If not specified, no XML Schema validation will be enforced unless it is enabled by other means, such as
Environment variable: | ||
4.2. Metrics Feature Copy linkLink copied to clipboard!
Collect metrics using Micrometer.
Unlike CXF Metrics feature, this Quarkus CXF extension does not support Dropwizard Metrics. Only Micrometer is supported.
4.2.1. Maven coordinates Copy linkLink copied to clipboard!
Create a new project using quarkus-cxf-rt-features-metrics on code.quarkus.redhat.com or add these coordinates to your existing project:
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-features-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-features-metrics</artifactId>
</dependency>
4.2.2. Usage Copy linkLink copied to clipboard!
The integration of CXF into the Quarkus Micrometer ecosystem is implemented using io.quarkiverse.cxf.metrics.QuarkusCxfMetricsFeature. As long as your application depends on quarkus-cxf-rt-features-metrics, an instance of QuarkusCxfMetricsFeature is created internally and enabled by default for all clients and service endpoints created by Quarkus CXF. You can disable it via quarkus.cxf.metrics.enabled-for, quarkus.cxf.client."client-name".metrics.enabled and quarkus.cxf.endpoint."/endpoint-path".metrics.enabled properties documented below.
4.2.2.1. Runnable example Copy linkLink copied to clipboard!
There is an integration test covering Micrometer Metrics in the Quarkus CXF source tree.
Unsurprisingly, it depends on quarkus-cxf-rt-features-metrics
pom.xml
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-features-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-features-metrics</artifactId>
</dependency>
It is using quarkus-micrometer-registry-prometheus extension to export the metrics in JSON format and for Prometheus:
pom.xml
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
</dependency>
The following configuration is needed to be able to inspect the collected metrics over a REST endpoint:
application.properties
quarkus.micrometer.export.json.enabled = true quarkus.micrometer.export.json.path = metrics/json quarkus.micrometer.export.prometheus.path = metrics/prometheus
quarkus.micrometer.export.json.enabled = true
quarkus.micrometer.export.json.path = metrics/json
quarkus.micrometer.export.prometheus.path = metrics/prometheus
Having all the above in place, you can start the application in Dev mode:
mvn quarkus:dev
$ mvn quarkus:dev
Now send a request to the HelloService:
curl \ -d '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:helloResponse xmlns:ns2="http://it.server.metrics.cxf.quarkiverse.io/"><return>Hello Joe!</return></ns2:helloResponse></soap:Body></soap:Envelope>' \ -H 'Content-Type: text/xml' \ -X POST \ http://localhost:8080/metrics/client/hello
$ curl \
-d '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:helloResponse xmlns:ns2="http://it.server.metrics.cxf.quarkiverse.io/"><return>Hello Joe!</return></ns2:helloResponse></soap:Body></soap:Envelope>' \
-H 'Content-Type: text/xml' \
-X POST \
http://localhost:8080/metrics/client/hello
After that, you should see some metrics under cxf.server.requests in the output of the endpoint you configured above:
4.2.3. Configuration Copy linkLink copied to clipboard!
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
| Configuration property | Type | Default |
|---|---|---|
|
|
| |
|
Specifies whether the metrics collection will be enabled for clients, services, both or none. This global setting can be overridden per client or service endpoint using the
Environment variable: | ||
|
List of | ||
|
A list of references to
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
4.3. OpenTelemetry Copy linkLink copied to clipboard!
Generate OpenTelemetry traces.
OpenTelemetry Metrics and Logging are not supported yet on neither Quarkus nor CXF side, hence Quarkus CXF cannot support them either. Tracing is thus the only OpenTelemetry feature supported by this extension.
4.3.1. Maven coordinates Copy linkLink copied to clipboard!
Create a new project using quarkus-cxf-integration-tracing-opentelemetry on code.quarkus.redhat.com or add these coordinates to your existing project:
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-integration-tracing-opentelemetry</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-integration-tracing-opentelemetry</artifactId>
</dependency>
4.3.2. Usage Copy linkLink copied to clipboard!
This extension builds on top of org.apache.cxf.tracing.opentelemetry.OpenTelemetryFeature (for service endpoints) and org.apache.cxf.tracing.opentelemetry.OpenTelemetryClientFeature (for clients). Instances of these are created and configured internally using the instance of io.opentelemetry.api.OpenTelemetry provided by Quarkus OpenTelemetry.
The tracing is enabled by default for all clients and service endpoints created by Quarkus CXF, unless you disable it explicitly via quarkus.cxf.otel.enabled-for, quarkus.cxf.client."client-name".otel.enabled or quarkus.cxf.endpoint."/endpoint-path".otel.enabled.
4.3.2.1. Runnable example Copy linkLink copied to clipboard!
There is an integration test covering OpenTelemetry in the Quarkus CXF source tree. It is using InMemorySpanExporter from io.opentelemetry:opentelemetry-sdk-testing, so that the spans can be inspected from tests easily. Refer to Quarkus OpenTelemetry guide for information about other supported span exporters and collectors.
4.3.3. Configuration Copy linkLink copied to clipboard!
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
| Configuration property | Type | Default |
|---|---|---|
|
|
| |
|
Specifies whether the OpenTelemetry tracing will be enabled for clients, services, both or none. This global setting can be overridden per client or service endpoint using the
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
4.4. WS-Security Copy linkLink copied to clipboard!
Provides CXF framework’s WS-Security implementation allowing you to:
- Pass authentication tokens between services
- Encrypt messages or parts of messages
- Sign messages
- Timestamp messages
4.4.1. Maven coordinates Copy linkLink copied to clipboard!
Create a new project using quarkus-cxf-rt-ws-security on code.quarkus.redhat.com or add these coordinates to your existing project:
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-ws-security</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-ws-security</artifactId>
</dependency>
4.4.2. Supported standards Copy linkLink copied to clipboard!
4.4.3. Usage Copy linkLink copied to clipboard!
The CXF framework’s WS-Security (WSS) implementation is based on WSS4J. It can be activated in two ways:
- By using WS-SecurityPolicy
- By adding WSS4J interceptors to your clients and service endpoints.
WS-SecurityPolicy is preferable because in that way, the security requirements become a part of the WSDL contract. That in turn greatly simplifies not only the implementation of clients and service endpoints but also the interoperability between vendors.
Nevertheless, if you leverage WS-SecurityPolicy, CXF sets up the WSS4J interceptors under the hood for you.
We won’t explain the manual approach with WSS4J interceptors in detail here, but you can still refer to our WS-Security integration test as an example.
4.4.3.1. WS-Security via WS-SecurityPolicy Copy linkLink copied to clipboard!
The sample code snippets used in this section come from the WS-SecurityPolicy integration test in the source tree of Quarkus CXF
Let’s say our aim is to ensure that the communication between the client and service is confidential (through encryption) and that the message has not been tampered with (through digital signatures). We also want to assure that the clients are who they claim to be by authenticating themselves by X.509 certificates.
We can express all these requirements in a single WS-SecurityPolicy document:
encrypt-sign-policy.xml
- 1
AsymmetricBindingspecifies the use of asymmetric (public/private key) cryptography for securing the communication between two parties- 2
InitiatorTokenindicates that the initiator (sender) of the message will use an X.509 certificate token that must always be provided to the recipient.- 3
SignedPartsspecifies which parts of the SOAP message must be signed to ensure their integrity.- 4
EncryptedPartsspecifies the parts of the SOAP message that must be encrypted to ensure their confidentiality.
We set this policy on the Service Endpoint Interface (SEI) EncryptSignPolicyHelloService using @org.apache.cxf.annotations.Policy annotation:
EncryptSignPolicyHelloService.java
@WebService(serviceName = "EncryptSignPolicyHelloService")
@Policy(placement = Policy.Placement.BINDING, uri = "encrypt-sign-policy.xml")
public interface EncryptSignPolicyHelloService extends AbstractHelloService {
...
}
@WebService(serviceName = "EncryptSignPolicyHelloService")
@Policy(placement = Policy.Placement.BINDING, uri = "encrypt-sign-policy.xml")
public interface EncryptSignPolicyHelloService extends AbstractHelloService {
...
}
On the first sight, setting the policy on the SEI should suffice to enforce it on both the service and all clients generated from the SEI or from the WSDL served by the service. However, that’s not all. Security keys, usernames, passwords and other kinds of confidental information cannot be exposed in a public policy.
Those have to be set in the configuration. Let’s do it for the service first:
application.properties
Similar setup is necessary on the client side:
application.properties
To inspect the flow of the messages, you can execute the EncryptSignPolicyTest as follows:
You should see some messages containing Signature elements and encrypted bodies in the console output.
4.4.4. Configuration Copy linkLink copied to clipboard!
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
| Configuration property | Type | Default |
|---|---|---|
|
| ||
| The user’s name. It is used as follows:
Environment variable: | ||
|
| ||
|
The user’s password when a
Environment variable: | ||
|
|
| |
|
The user’s name for signature. It is used as the alias name in the keystore to get the user’s cert and private key for signature. If this is not defined, then
Environment variable: | ||
|
|
| |
|
The user’s password for signature when a
Environment variable: | ||
|
|
| |
|
The user’s name for encryption. It is used as the alias name in the keystore to get the user’s public key for encryption. If this is not defined, then
For the WS-Security web service provider, the
Environment variable: | ||
|
| ||
|
A reference to a
Environment variable: | ||
|
|
| |
|
A reference to a
Environment variable: | ||
|
|
| |
|
The Crypto property configuration to use for signing, if Example [prefix].signature.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin [prefix].signature.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password [prefix].signature.properties."org.apache.ws.security.crypto.merlin.file" = certs/alice.jks
Environment variable: | ||
|
|
| |
|
The Crypto property configuration to use for encryption, if Example [prefix].encryption.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin [prefix].encryption.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password [prefix].encryption.properties."org.apache.ws.security.crypto.merlin.file" = certs/alice.jks
Environment variable: | ||
|
| ||
|
A reference to a
Environment variable: | ||
|
| ||
|
A reference to a
Environment variable: | ||
|
|
| |
|
A message property for prepared X509 certificate to be used for encryption. If this is not defined, then the certificate will be either loaded from the keystore This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If Signature The label "unsigned" refers to an internal signature. Even if the token is signed by an external signature (as per the "sender-vouches" requirement), this boolean must still be configured if you want to use the token to set up the security context. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The attribute URI of the SAML This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A String of regular expressions (separated by the value specified in This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The separator that is used to parse certificate constraints configured in This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
| ||
|
The actor or role name of the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
|
|
|
|
Whether to always encrypt This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
If Caching
Caching only applies when either a
Environment variable: | ||
|
|
| |
|
If Caching
Caching only applies when either a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
|
|
|
|
If The "real" security errors should not be returned to the client in production, as they may leak information about the deployment, or otherwise provide an "oracle" for attacks.
Environment variable: | ||
|
|
| |
|
If
Works only with
Environment variable: | ||
|
| ||
|
If
Caching only applies when either a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
| Whether to store bytes (CipherData or BinarySecurityToken) in an attachment. The default is true if MTOM is enabled. Set it to false to BASE-64 encode the bytes and "inlined" them in the message instead. Setting this to true is more efficient, as it means that the BASE-64 encoding step can be skipped. This only applies to the DOM WS-Security stack. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
If
Some frameworks cannot process the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If Some servers may not do client certificate verification at the start of the SSL handshake, and therefore the client certificates may not be available to the WS-Security layer for policy verification. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The time in seconds to add to the Creation value of an incoming This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The time in seconds in the future within which the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The time in seconds to append to the Creation value of an incoming This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The time in seconds in the future within which the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
| ||
|
Set this property to point to a configuration file for the underlying caching implementation for the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
| ||
|
The Cache Identifier to use with the TokenStore. CXF uses the following key to retrieve a token store:
The default This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
| ||
|
The Subject Role Classifier to use. If one of the WSS4J Validators returns a JAAS Subject from Validation, then the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The Subject Role Classifier Type to use. If one of the WSS4J Validators returns a JAAS Subject from Validation, then the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
| This configuration tag allows the user to override the default Asymmetric Signature algorithm (RSA-SHA1) for use in WS-SecurityPolicy, as the WS-SecurityPolicy specification does not allow the use of other algorithms at present. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
| This configuration tag allows the user to override the default Symmetric Signature algorithm (HMAC-SHA1) for use in WS-SecurityPolicy, as the WS-SecurityPolicy specification does not allow the use of other algorithms at present. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a
By default, WSS4J uses the The encrypted passwords must be stored in the format "ENC(encoded encrypted password)". This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a Kerberos This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
| The security token lifetime value (in milliseconds). This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
| The JAAS Context name to use for Kerberos. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
| ||
| The Kerberos Service Provider Name (spn) to use. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
| ||
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The Digest Algorithm to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Encryption Algorithm to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Symmetric Key Encryption Algorithm to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Asymmetric Key Encryption Algorithm to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Encryption Key Derivation to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Signature Key Derivation to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Encryption Derived Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Signature Derived Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Minimum Symmetric Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Maximum Symmetric Key Length to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Minimum Symmetric Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Maximum Symmetric Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
| ||
|
A reference to a fully configured
To work around the fact that Tip Check the Security Token Service (STS) extension page for more information about WS-Trust.
Environment variable: | ||
|
| ||
| A URL, resource path or local filesystem path pointing to a WSDL document to use when generating the service proxy of the STS client.
Environment variable: | ||
|
|
| |
| A fully qualified name of the STS service. Common values include:
Environment variable: | ||
|
|
| |
| A fully qualified name of the STS endpoint name. Common values include:
Environment variable: | ||
|
|
| |
| The user name to use when authenticating against the STS. It is used as follows:
Environment variable: | ||
|
|
| |
|
The password associated with the
Environment variable: | ||
|
|
| |
|
The user’s name for encryption. It is used as the alias name in the keystore to get the user’s public key for encryption. If this is not defined, then
For the WS-Security web service provider, the
Environment variable: | ||
|
|
| |
|
The Crypto property configuration to use for encryption, if Example [prefix].encryption.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin [prefix].encryption.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password [prefix].encryption.properties."org.apache.ws.security.crypto.merlin.file" = certs/alice.jks
Environment variable: | ||
|
|
| |
|
A reference to a
Environment variable: | ||
|
|
| |
|
A reference to a WCF’s trust server sometimes will encrypt the token in the response IN ADDITION TO the full security on the message. These properties control the way the STS client will decrypt the EncryptedData elements in the response.
These are also used by the
Environment variable: | ||
|
|
| |
|
The Crypto property configuration to use for encryption, if Example [prefix].token.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin [prefix].token.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password [prefix].token.properties."org.apache.ws.security.crypto.merlin.file" = certs/alice.jks
Environment variable: | ||
|
|
| |
| The alias name in the keystore to get the user’s public key to send to the STS for the PublicKey KeyType case.
Environment variable: | ||
|
|
|
|
| Whether to write out an X509Certificate structure in UseKey/KeyInfo, or whether to write out a KeyValue structure.
Environment variable: | ||
|
|
|
|
|
If
Environment variable: | ||
|
| ||
| The user’s name. It is used as follows:
Environment variable: | ||
|
| ||
|
The user’s password when a
Environment variable: | ||
|
|
| |
|
The user’s name for signature. It is used as the alias name in the keystore to get the user’s cert and private key for signature. If this is not defined, then
Environment variable: | ||
|
|
| |
|
The user’s password for signature when a
Environment variable: | ||
|
|
| |
|
The user’s name for encryption. It is used as the alias name in the keystore to get the user’s public key for encryption. If this is not defined, then
For the WS-Security web service provider, the
Environment variable: | ||
|
|
| |
|
A reference to a
Environment variable: | ||
|
|
| |
|
A reference to a
Environment variable: | ||
|
|
| |
|
The Crypto property configuration to use for signing, if Example [prefix].signature.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin [prefix].signature.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password [prefix].signature.properties."org.apache.ws.security.crypto.merlin.file" = certs/alice.jks
Environment variable: | ||
|
|
| |
|
The Crypto property configuration to use for encryption, if Example [prefix].encryption.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin [prefix].encryption.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password [prefix].encryption.properties."org.apache.ws.security.crypto.merlin.file" = certs/alice.jks
Environment variable: | ||
|
|
| |
|
A reference to a
Environment variable: | ||
|
|
| |
|
A reference to a
Environment variable: | ||
|
|
| |
|
A message property for prepared X509 certificate to be used for encryption. If this is not defined, then the certificate will be either loaded from the keystore This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If Signature The label "unsigned" refers to an internal signature. Even if the token is signed by an external signature (as per the "sender-vouches" requirement), this boolean must still be configured if you want to use the token to set up the security context. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The attribute URI of the SAML This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A String of regular expressions (separated by the value specified in This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The separator that is used to parse certificate constraints configured in This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
| ||
|
The actor or role name of the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If
Environment variable: | ||
|
|
|
|
|
Whether to always encrypt This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
If Caching
Caching only applies when either a
Environment variable: | ||
|
|
| |
|
If Caching
Caching only applies when either a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If
Environment variable: | ||
|
|
|
|
|
If The "real" security errors should not be returned to the client in production, as they may leak information about the deployment, or otherwise provide an "oracle" for attacks.
Environment variable: | ||
|
|
|
|
|
If
Works only with
Environment variable: | ||
|
|
| |
|
If
Caching only applies when either a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
| Whether to store bytes (CipherData or BinarySecurityToken) in an attachment. The default is true if MTOM is enabled. Set it to false to BASE-64 encode the bytes and "inlined" them in the message instead. Setting this to true is more efficient, as it means that the BASE-64 encoding step can be skipped. This only applies to the DOM WS-Security stack. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If
Some frameworks cannot process the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If Some servers may not do client certificate verification at the start of the SSL handshake, and therefore the client certificates may not be available to the WS-Security layer for policy verification. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The time in seconds to add to the Creation value of an incoming This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The time in seconds in the future within which the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The time in seconds to append to the Creation value of an incoming This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The time in seconds in the future within which the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
Set this property to point to a configuration file for the underlying caching implementation for the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
The Cache Identifier to use with the TokenStore. CXF uses the following key to retrieve a token store:
The default This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
The Subject Role Classifier to use. If one of the WSS4J Validators returns a JAAS Subject from Validation, then the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The Subject Role Classifier Type to use. If one of the WSS4J Validators returns a JAAS Subject from Validation, then the This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
| This configuration tag allows the user to override the default Asymmetric Signature algorithm (RSA-SHA1) for use in WS-SecurityPolicy, as the WS-SecurityPolicy specification does not allow the use of other algorithms at present. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
| This configuration tag allows the user to override the default Symmetric Signature algorithm (HMAC-SHA1) for use in WS-SecurityPolicy, as the WS-SecurityPolicy specification does not allow the use of other algorithms at present. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a
By default, WSS4J uses the The encrypted passwords must be stored in the format "ENC(encoded encrypted password)". This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a Kerberos This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
| The security token lifetime value (in milliseconds). This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
If This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
| The JAAS Context name to use for Kerberos. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
| ||
| The Kerberos Service Provider Name (spn) to use. This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
| |
|
A reference to a This option is experimental, because it is not covered by tests yet.
Environment variable: | ||
|
|
|
|
|
The Digest Algorithm to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Encryption Algorithm to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Symmetric Key Encryption Algorithm to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Asymmetric Key Encryption Algorithm to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Encryption Key Derivation to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Signature Key Derivation to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Encryption Derived Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Signature Derived Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Minimum Symmetric Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Maximum Symmetric Key Length to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Minimum Symmetric Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
|
|
|
|
|
The Maximum Symmetric Key Length (number of bits) to set on the For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.
Environment variable: | ||
4.5. WS-ReliableMessaging Copy linkLink copied to clipboard!
WS-ReliableMessaging (WS-RM) is a protocol ensuring a reliable delivery of messages in a distributed environment even in presence of software, system, or network failures.
This extension provides CXF framework’s WS-ReliableMessaging implementation.
4.5.1. Maven coordinates Copy linkLink copied to clipboard!
Create a new project using quarkus-cxf-rt-ws-rm on code.quarkus.redhat.com or add these coordinates to your existing project:
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-ws-rm</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-ws-rm</artifactId>
</dependency>
4.5.2. Supported standards Copy linkLink copied to clipboard!
4.5.3. Usage Copy linkLink copied to clipboard!
Once your application depends on quarkus-cxf-rt-ws-rm, WS-RM is enabled for all clients and service endpoints defined in application.properties. This is due to the fact that the quarkus.cxf.client."client-name".rm.enabled and quarkus.cxf.endpoint."/endpoint-path".rm.enabled properties are true by default.
Enabling WS-RM for a client or service endpoints means that WS-RM interceptors will be added to the given client or endpoint.
In addition to that you may want to set some of the options documented below and/or the following WS-Addressing options:
4.5.3.1. Runnable example Copy linkLink copied to clipboard!
There is an integration test covering WS-RM with a decoupled endpoint in the Quarkus CXF source tree.
It is split into two separate applications that communicate with each other:
To run it, you need to install the server into your local Maven repository first
cd test-util-parent/test-ws-rm-server-jvm mvn clean install
$ cd test-util-parent/test-ws-rm-server-jvm
$ mvn clean install
And then you can run the test scenario implemented in the client module:
cd ../../integration-tests/ws-rm-client mvn clean test
$ cd ../../integration-tests/ws-rm-client
$ mvn clean test
You should see the exchange of SOAP messages between the client, the server and the decoupled endpoint in the console.
4.5.4. Configuration Copy linkLink copied to clipboard!
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
| Configuration property | Type | Default |
|---|---|---|
|
|
| |
|
WS-RM version namespace:
Environment variable: | ||
|
|
| |
|
WS-Addressing version namespace:
Environment variable: | ||
|
| ||
| A time duration in milliseconds after which the associated sequence will be closed if no messages (including acknowledgments and other control messages) were exchanged between the sender and receiver during that period of time. If not set, the associated sequence will never be closed due to inactivity.
Environment variable: | ||
|
|
| |
| A time duration in milliseconds between successive attempts to resend a message that has not been acknowledged by the receiver.
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
| ||
| A time duration in milliseconds within which an acknowledgement for a received message is expected to be sent by a RM destination. If not specified, the acknowledgements will be sent immediately.
Environment variable: | ||
|
| ||
|
A reference to a
Environment variable: | ||
|
|
| |
|
A reference to a
If the value is
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
4.6. Security Token Service (STS) Copy linkLink copied to clipboard!
Issue, renew and validate security tokens in context of WS-Trust.
4.6.1. Maven coordinates Copy linkLink copied to clipboard!
Create a new project using quarkus-cxf-services-sts on code.quarkus.redhat.com or add these coordinates to your existing project:
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-services-sts</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-services-sts</artifactId>
</dependency>
4.6.2. Supported standards Copy linkLink copied to clipboard!
4.6.3. Usage Copy linkLink copied to clipboard!
Here are the key parts of a basic WS-Trust scenario:
-
WS-SecurityPolicy - except for defining security requirements, such as transport protocols, encryption and signing, it can also contain an
<IssuedToken>assertion. It specifies the requirements and constraints for these security tokens that the client must adhere to when accessing the service. - Security Token Service (STS) - issues, validates, and renews security tokens upon request. It acts as a trusted authority that authenticates clients and issues tokens that assert the client’s identity and permissions.
- Client - requests a token from the STS to access a web service. It must authenticate itself to the STS and provide details about the kind of token required.
- Service - relies on the STS to authenticate clients and validate their tokens.
4.6.3.1. Runnable example Copy linkLink copied to clipboard!
There is an integration test covering WS-Trust in the Quarkus CXF source tree. Let’s walk through it and see how the individual parts are set to work together.
4.6.3.1.1. WS-SecurityPolicy Copy linkLink copied to clipboard!
The policy is located in asymmetric-saml2-policy.xml file. Its key part is the <IssuedToken> assertion requiring a SAML 2.0 token:
asymmetric-saml2-policy.xml
4.6.3.1.2. Security Token Service (STS) Copy linkLink copied to clipboard!
The STS is implemented in Sts.java:
Sts.java
and configured in application.properties:
application.properties
4.6.3.1.3. Service Copy linkLink copied to clipboard!
The service is implemented in TrustHelloServiceImpl.java:
TrustHelloServiceImpl.java
The asymmetric-saml2-policy.xml mentioned above is set in the Service Endpoint Interface TrustHelloService.java:
TrustHelloServiceImpl.java
The service endpoint is configured in application.properties:
application.properties
4.6.3.1.4. Client Copy linkLink copied to clipboard!
Finally, for the SOAP client to be able to communicate with the service, its STSClient needs to be configured. It can be done in application.properties:
application.properties
The properties for configuring the STS client are provided by the io.quarkiverse.cxf:quarkus-cxf-rt-ws-security extension and documented on its reference page.
Alternatively, the client can be set as a bean reference:
application.properties
quarkus.cxf.client.hello-ws-trust-bean.security.sts.client = #stsClientBean
quarkus.cxf.client.hello-ws-trust-bean.security.sts.client = #stsClientBean
In that case, the @Named bean needs to be produced programmatically, e.g. using @jakarta.enterprise.inject.Produces:
BeanProducers.java
4.7. HTTP Async Transport Copy linkLink copied to clipboard!
Implement async SOAP Clients using Apache HttpComponents HttpClient 5.
4.7.1. Maven coordinates Copy linkLink copied to clipboard!
Create a new project using quarkus-cxf-rt-transports-http-hc5 on code.quarkus.redhat.com or add these coordinates to your existing project:
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-transports-http-hc5</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-transports-http-hc5</artifactId>
</dependency>
4.7.2. Usage Copy linkLink copied to clipboard!
Once the quarkus-cxf-rt-transports-http-hc5 dependency is available in the classpath, CXF will use HttpAsyncClient for asynchronous calls and will continue using HttpURLConnection for synchronous calls.
4.7.2.1. Generate async methods Copy linkLink copied to clipboard!
Asynchronous client invocations require some additional methods in the service endpoint interface. That code is not generated by default.
To enable it, you need to create a JAX-WS binding file with enableAsyncMapping set to true:
The sample code snippets used in this section come from the HC5 integration test in the source tree of Quarkus CXF
src/main/resources/wsdl/async-binding.xml
This file should then be passed to wsdl2java through its additional-params property:
application.properties
quarkus.cxf.codegen.wsdl2java.includes = wsdl/*.wsdl quarkus.cxf.codegen.wsdl2java.additional-params = -b,src/main/resources/wsdl/async-binding.xml
quarkus.cxf.codegen.wsdl2java.includes = wsdl/*.wsdl
quarkus.cxf.codegen.wsdl2java.additional-params = -b,src/main/resources/wsdl/async-binding.xml
4.7.2.2. Asynchronous Clients and Mutiny Copy linkLink copied to clipboard!
Once the asynchronous stubs are available, it is possible to wrap a client call in io.smallrye.mutiny.Uni as shown below:
4.7.2.3. Thread pool Copy linkLink copied to clipboard!
Asynchronous clients delivered by this extension leverage ManagedExecutor with a thread pool provided by Quarkus. The thread pool can be configured using the quarkus.thread-pool.* family of options. As a consequence of this, the executor and thread pool related attributes of org.apache.cxf.transports.http.configuration.HTTPClientPolicy are not honored for async clients on Quarkus.
You can see more details about the CXF asynchronous client and how to tune it further in CXF documentation.
4.8. XJC Plugins Copy linkLink copied to clipboard!
XJC plugins for wsdl2java code generation. You’ll need to add this extension if you want to use any of the following in quarkus.cxf.codegen.wsdl2java.additional-params:
-
-xjc-Xbg- generategetFoo()instead ofisFoo()accessor methods for boolean fields. -
-xjc-Xdv- let the generated getter methods return the default value defined in the schema unless the field is set explicitly. -
-xjc-Xjavadoc- generate JavaDoc based onxs:documentationpresent in the schema. -
-xjc-Xproperty-listener- addPropertyChangeListenersupport to the generated beans. -
-xjc-Xts- generatetoString()methods in model classes. -
-xjc-Xwsdlextension- generate beans that can be used directly with WSDL4J as extensors in the WSDL.
Check the wsdl2java section of User guide for more details about wsdl2java.
4.8.1. Maven coordinates Copy linkLink copied to clipboard!
Create a new project using quarkus-cxf-xjc-plugins on code.quarkus.redhat.com or add these coordinates to your existing project:
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-xjc-plugins</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-xjc-plugins</artifactId>
</dependency>
Chapter 5. Quarkus CXF user guide Copy linkLink copied to clipboard!
This chapter provides information about Quarkus CXF usage and configuration.
5.1. User guide Copy linkLink copied to clipboard!
This User guide explains typical use cases of Quarkus CXF.
You may want to start with some of the following topics:
5.1.1. Create a new project Copy linkLink copied to clipboard!
This guide explains how to set up a new project for a Quarkus application hosting a CXF client or server or both.
5.1.1.1. Prerequisites Copy linkLink copied to clipboard!
Read the Prerequisites section of Quarkus getting started guide.
In addition to that, you may need
-
GraalVM with the
native-imagecommand installed and theGRAALVM_HOMEenvironment variable set. See Building a native executable section of the Quarkus documentation. -
If you are on Linux, a container runtime like
dockeris sufficient for the native mode too. Use-Pnative -Dquarkus.native.container-build=trueinstead of-Pnativeif you choose this option.
5.1.1.2. Creating a project Copy linkLink copied to clipboard!
New project skeletons can be generated using code.quarkus.redhat.com.
- Here you can select the extensions that you want to work with.
-
For a simple Hello world Web service or client the
quarkus-cxfextension is enough. -
Click the blue
Generate your applicationbutton to download a basic skeleton project. - Unpack the zip file and import the project the into your favorite IDE.
5.1.1.3. Quarkus Platform Copy linkLink copied to clipboard!
Quarkus CXF is a part of Quarkus Platform since Quarkus Platform version 3.1.0.Final.
Quarkus Platform aggregates Quarkus extensions produced by various independent projects, such as Quarkus Core, Quarkus CXF, Apache Camel, Qpid JMS, Debezium and others.
Its main goals are:
- Produce BOMs aligned across all participating projects, thus ensuring that their extensions will work together
- Produce metadata for code.quarkus.redhat.com and other Quarkus development tools.
5.1.1.4. Dependency management Copy linkLink copied to clipboard!
We recommend using Quarkus Platform BOMs to manage Quarkus CXF dependencies. That’s exactly what you get, when you use code.quarkus.redhat.com or other Quarkus development tools, such as Quarkus CLI.
You should always take care to import the same version of io.quarkus.platform:quarkus-bom and io.quarkus.platform:quarkus-cxf-bom into your project. That’s the most reliable way to get compatible versions of Quarkus, CXF, Quarkus CXF and all their transitive dependencies.
5.1.1.5. Where to go next Copy linkLink copied to clipboard!
We recommend to proceed with any of the following chapters:
5.1.2. Your first SOAP Web service on Quarkus Copy linkLink copied to clipboard!
In this guide we explain how to create a Quarkus application exposing a simple SOAP Web service.
Follow the Project creation guide before proceeding here.
5.1.2.1. Hello world! Web service Copy linkLink copied to clipboard!
Having the pom.xml in place, you can add a simple Hello world! Web service in src/main/java.
The sample code snippets used in this section come from the server integration test in the source tree of Quarkus CXF
First add the service interface:
HelloService.java
and then the implementation:
HelloServiceImpl.java
For the implementation to get exposed under a certain path, you need to add the following configuration to application.properties:
All configuration properties are documented in the Configuration properties reference.
Check the Service endpoints and paths chapter to learn about alternative ways to expose a service endpoint under a specific path.
With these files in place, you can start Quarkus in dev mode:
mvn quarkus:dev
$ mvn quarkus:dev
This will compile the project and start the application on the background.
You can test the service using curl or some other SOAP client.
First let’s have a look at the auto-generated WSDL under http://localhost:8080/soap/hello?wsdl:
Second, let’s send a SOAP request to the service:
You can see the expected <return>Hello World!</return> in the SOAP response.
5.1.2.2. Add the logging feature while dev mode is running Copy linkLink copied to clipboard!
Sometimes it may come in handy to be able to inspect the SOAP messages received or sent by the server or client. This is easily doable by adding the quarkus-cxf-rt-features-logging extension to pom.xml.
Try to do that while Quarkus dev mode is running. You should see the application being recompiled and redeployed upon saving your changes in the source tree.
Add this to pom.xml
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-features-logging</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-rt-features-logging</artifactId>
</dependency>
Enable SOAP payload logging in application.properties
quarkus.cxf.endpoint."/hello".features=org.apache.cxf.ext.logging.LoggingFeature
quarkus.cxf.endpoint."/hello".features=org.apache.cxf.ext.logging.LoggingFeature
After that you can send a new SOAP request and see some SOAP payloads in the application console:
5.1.2.3. Further steps Copy linkLink copied to clipboard!
You may want to proceed with packaging your application for running on a JVM or natively.
5.1.3. Your first SOAP Client on Quarkus Copy linkLink copied to clipboard!
In this guide we explain how to create a simple Quarkus application acting as a client of a remote Web service.
Follow the Project creation guide before proceeding here.
5.1.3.1. Remote Web service for testing Copy linkLink copied to clipboard!
First, we need some remote Web service to connect to. We can use a simple Calculator Web service running in a container for that purpose.
docker run -p 8082:8080 quay.io/l2x6/calculator-ws:1.0
$ docker run -p 8082:8080 quay.io/l2x6/calculator-ws:1.0
Once the container is up and running, we can inspect its WSDL
As you can see in the WSDL, the service offers some basic arithmetic operations, such as add, subtract, etc.
Let’s test it with curl:
5.1.3.2. SOAP client Copy linkLink copied to clipboard!
Now let’s have a look how we can get the client inside a Quarkus application.
First, we need the Service Endpoint Interface (SEI) and all other model classes it requires.
There are several ways to get them:
- Write by hand
- Copy from the Web Sevice project, if it is written in Java
- Have a Maven artifact containing the model classes, perhaps it is offered by the Service project
- Generate the model classes from WSDL
The last option tends to be the easiest and most flexible for client applications.
If you want to use this approach, first follow the Generate Java from WSDL section and then continue with the next steps.
5.1.3.3. Using SEI as a client Copy linkLink copied to clipboard!
In our case, the Service Endpoint Interface (SEI) is org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService.
As usual on Quarkus, we can obtain an instance of it via CDI.
To make it testable easily, we’ll wrap it in a REST service:
CxfClientResource.java
Is this all we need for the client to work? - No, in addition to the above, we need to tell a few other things to the CXF Quarkus extension in application.properties:
application.properties
cxf.it.calculator.baseUri=http://localhost:8082
quarkus.cxf.client.myCalculator.wsdl = ${cxf.it.calculator.baseUri}/calculator-ws/CalculatorService?wsdl
quarkus.cxf.client.myCalculator.client-endpoint-url = ${cxf.it.calculator.baseUri}/calculator-ws/CalculatorService
quarkus.cxf.client.myCalculator.service-interface = org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService
cxf.it.calculator.baseUri=http://localhost:8082
quarkus.cxf.client.myCalculator.wsdl = ${cxf.it.calculator.baseUri}/calculator-ws/CalculatorService?wsdl
quarkus.cxf.client.myCalculator.client-endpoint-url = ${cxf.it.calculator.baseUri}/calculator-ws/CalculatorService
quarkus.cxf.client.myCalculator.service-interface = org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService
All client configuration properties are documented in the Configuration properties reference.
With all the above files in place, we should be able to start the application in Quarkus dev mode
mvn quarkus:dev ... INFO [io.quarkus] (Quarkus Main Thread) ... Listening on: http://localhost:8080
$ mvn quarkus:dev
...
INFO [io.quarkus] (Quarkus Main Thread) ... Listening on: http://localhost:8080
and test it by sending some requests to it:
curl -s 'http://localhost:8080/cxf/calculator-client/add?a=5&b=6' 11
$ curl -s 'http://localhost:8080/cxf/calculator-client/add?a=5&b=6'
11
where 11 is the correct result of adding 5 and 6.
5.1.3.4. Further steps Copy linkLink copied to clipboard!
You may want to proceed with
5.1.4. Configuration Copy linkLink copied to clipboard!
Quarkus CXF exposes a large number of configuration options. Each extension documents its options at the bottom of its reference page.
The configuration options can be set in application.properties file or via environment variables - see Quarkus configuration reference for details.
5.1.4.1. Bean references Copy linkLink copied to clipboard!
Several configuration options of Quarkus CXF allow referring to beans present in Quarkus CDI container. Features and interceptors are typical examples of those.
There are two ways how to set a bean reference in the configuration: by type or by bean name.
5.1.4.1.1. Bean reference by type Copy linkLink copied to clipboard!
Here is an example:
application.properties
bean reference by type quarkus.cxf.endpoint."/hello".features = org.apache.cxf.ext.logging.LoggingFeature
# bean reference by type
quarkus.cxf.endpoint."/hello".features = org.apache.cxf.ext.logging.LoggingFeature
When using a reference by type name, the resolution proceeds as follows:
- Fist the bean is looked up in Quarkus CDI container by type.
- If the bean is available, it is used.
- If multiple beans assignable to the given type, then an exception is thrown.
- If no matching bean is available, then the class is loaded and an attempt is performed to instantiate it using its default constructor.
5.1.4.1.2. Bean reference by bean name Copy linkLink copied to clipboard!
Here is an example:
application.properties
bean reference by bean name quarkus.cxf.endpoint."/fruit".features = #myCustomLoggingFeature
# bean reference by bean name
quarkus.cxf.endpoint."/fruit".features = #myCustomLoggingFeature
When using a reference by bean name, then unsurprisingly, the bean is looked up in Quarkus CDI container by name. A named bean called myCustomLoggingFeature can be defined as follows:
5.1.5. Package for running on a JVM or natively Copy linkLink copied to clipboard!
In this chapter, we explain how to package a Quarkus CXF application for running on a JVM or for running it natively.
5.1.5.1. JVM mode Copy linkLink copied to clipboard!
In the introductory guides for SOAP client and SOAP service, we worked only in Quarkus dev mode: Quarkus tooling was running on the background, watching for changes in our workspace, recompiling and reloading the application as needed.
How do we run the application on a JVM once we are done with the development?
First we need to package it with Maven:
mvn package
$ mvn package
The libraries needed to run the application on a JVM can be found in target/quarkus-app directory:
We can start the application as follows:
java -jar target/quarkus-app/quarkus-run.jar
$ java -jar target/quarkus-app/quarkus-run.jar
You can send some SOAP requests using curl to make sure that the application works.
5.1.5.2. Native mode Copy linkLink copied to clipboard!
Quarkus offers first class support for building GraalVM native images and Quarkus CXF fully honors that promise too.
GraalVM native images are platform specific executable files that you can run directly without a JVM. They boot faster and spend less memory compared to running the same application in JVM mode.
The pom.xml file generated by code.quarkus.redhat.com contains the native profile needed for building the native image:
Further, as mentioned in the Section 5.1.1, “Create a new project” section, you need the GraalVM native-image tool.
You should either have it installed locally and have GRAALVM_HOME environment variable set properly, or — if you only need to produce a Linux native executable — you can use docker.
With local installation of GraalVM
Quarkus is quite picky about the GraalVM version. When using the local installation, always make sure that you use the version preferred by Quarkus. You can do that by opening quarkus-bom imported in your pom.xml and searching for graalvm there. If you use Docker, Quarkus takes care for pulling the right version for you.
With docker
# Produce the native executable mvn package -Pnative -Dquarkus.native.container-build=true
# Produce the native executable
mvn package -Pnative -Dquarkus.native.container-build=true
This can take a minute or so for a simple application.
When the build is done, the native executable should be available in target directory:
ls -l target ... -rwxr-xr-x. 1 ppalaga ppalaga 71M Jan 11 22:42 quarkus-cxf-integration-test-server-1.8.0-SNAPSHOT-runner ...
$ ls -l target
...
-rwxr-xr-x. 1 ppalaga ppalaga 71M Jan 11 22:42 quarkus-cxf-integration-test-server-1.8.0-SNAPSHOT-runner
...
As you can see, it has a size of only 71 MB, and is executable.
You can run it as follows:
target/*-runner ... INFO [io.quarkus] (main) quarkus-cxf-integration-test-server 1.8.0-SNAPSHOT native (powered by Quarkus 2.15.2.Final) started in 0.042s. Listening on: http://0.0.0.0:8080 ...
$ target/*-runner
...
INFO [io.quarkus] (main) quarkus-cxf-integration-test-server 1.8.0-SNAPSHOT native (powered by Quarkus
2.15.2.Final) started in 0.042s. Listening on: http://0.0.0.0:8080
...
Again, you can send some SOAP requests using curl to make sure that the native executable works.
Do not forget to compare the memory usage, time to first request and other performance metrics with the stack you used before and share your results!
5.1.5.3. Native Image: Additional Resources Copy linkLink copied to clipboard!
You may also refer to the links below which contain tips on how to work with native images.
5.1.5.4. Create container image Copy linkLink copied to clipboard!
Refer to Quarkus Container image guide.
5.1.6. Logging Copy linkLink copied to clipboard!
Refer to Quarkus Logging guide for basic information about logging on Quarkus, such as
- Getting a logger in your application code
- Log levels
- Categories
- Format
- JSON format
5.1.6.1. Payload logging Copy linkLink copied to clipboard!
Since Quarkus CXF 2.6.0, the payload logging functionality is available via io.quarkiverse.cxf:quarkus-cxf extension. Before 2.6.0, it was available through a separate extension io.quarkiverse.cxf:quarkus-cxf-rt-features-logging which is now deprecated and will be removed in the future.
The payload logging functionality is implemented primarily through the org.apache.cxf.ext.logging.LoggingFeature class.
There are several ways how you can set the feature on a client or service endpoint.
5.1.6.2. Configuring payload logging through configuration properties Copy linkLink copied to clipboard!
5.1.6.2.1. Global settings Copy linkLink copied to clipboard!
The global logging options exist since Quarkus CXF 2.6.0. They need to be enabled using quarkus.cxf.logging.enabled-for. There are four possible values:
-
none(default) - the global logging feature is enabled for neither clients nor service endpoints -
clients- the global logging feature is enabled for all clients in the application -
services- the global logging feature is enabled for all service endpoints in the application -
both- the global logging feature is enabled for all clients and service endpoints in the application
The global settings can be overriden on the client or service endpoint level.
application.properties
# Global settings quarkus.cxf.logging.enabled-for = both quarkus.cxf.logging.pretty = true
# Global settings
quarkus.cxf.logging.enabled-for = both
quarkus.cxf.logging.pretty = true
All logging configuration options are listed on quarkus-cxf reference page.
All logging properties mentioned on this page are runtime configuration options. Hence you can pass them when starting the application without having to rebuild it. It can be done either by passing a system property on the command line (e.g. -Dquarkus.cxf.logging.enabled-for=both) or by setting an environment variable (e.g. export QUARKUS_CXF_LOGGING_ENABLED_FOR=both).
5.1.6.2.2. Per client and per service endpoint settings Copy linkLink copied to clipboard!
Since Quarkus CXF 2.5.0, the LoggingFeature can be configured and attached to a client or a service endpoint declaratively by setting the appropriate options in application.properties:
application.properties
All logging configuration options are documented on quarkus-cxf reference page:
5.1.6.3. Alternative ways of adding a LoggingFeature to a client or service Copy linkLink copied to clipboard!
To attach an instance with default settings, you can do one of the following:
In
application.properties:# For a service: quarkus.cxf.endpoint."/hello".features = org.apache.cxf.ext.logging.LoggingFeature # For a client: quarkus.cxf.client."myClient".features = org.apache.cxf.ext.logging.LoggingFeature
# For a service: quarkus.cxf.endpoint."/hello".features = org.apache.cxf.ext.logging.LoggingFeature # For a client: quarkus.cxf.client."myClient".features = org.apache.cxf.ext.logging.LoggingFeatureCopy to Clipboard Copied! Toggle word wrap Toggle overflow TipThere is an example in Your first SOAP Web service chapter of the User guide.
or alternatively
Use the
@Featuresannotation of CXF:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.1.6.3.1. Producing a custom LoggingFeature bean Copy linkLink copied to clipboard!
If you need some custom logic to setup the LoggingFeature, you can produce a named LoggingFeature bean:
Then you can refer to it by its name prefixed with # in application.properties:
# For a service: quarkus.cxf.endpoint."/hello".features = #limitedLoggingFeature # For a client: quarkus.cxf.client.hello.features = #limitedLoggingFeature
# For a service:
quarkus.cxf.endpoint."/hello".features = #limitedLoggingFeature
# For a client:
quarkus.cxf.client.hello.features = #limitedLoggingFeature
5.1.7. Complex SOAP payloads with JAXB Copy linkLink copied to clipboard!
Our introductory guides for Quarkus SOAP client and SOAP service dealt with services having only primitive parameters and return values such as integers and strings. Let’s have a look at passing and receiving more complex objects.
As an example, let’s create an application for managing fruits.
The sample code snippets used in this section come from the server integration test in the source tree of Quarkus CXF
Because our representation of fruit is supposed to be a complex, let’s model it as a Java bean with a couple of attributes:
As you may have noticed, we have used some JAXB annotations, such as @XmlElement, @XmlRootElement and @XmlType. This is to control the serialization and deserialization of the bean from and to XML.
5.1.7.1. Automatic registration for reflection Copy linkLink copied to clipboard!
JAXB is a reflection based serialization framework. When learning about GraalVM native images, one of the first things you typically hear is that you have to register classes, fields and methods for reflection at build time. With plain GraalVM you’d have to do this through reflection-config.json manually. Well, at least for the classes you have written yourself. Not so with Quarkus. quarkus-jaxb extension (which quarkus-cxf depends on) is able to scan your application’s class path for classes annotated with JAXB annotations and register them for reflection automatically.
Hence working with complex payloads on Quarkus is not different from stock CXF. The JAXB serialization and deserialization will work out of the box without any additional configuration.
5.1.7.2. SEI and implementation Copy linkLink copied to clipboard!
The Service Endpoint Interface (SEI) for managing fruits might look like the following:
We can implement the SEI as simply as possible:
5.1.7.3. application.properties Copy linkLink copied to clipboard!
The implementation is pretty straightforward and you just need to define your endpoints using the application.properties.
quarkus.cxf.endpoint."/fruits".implementor = io.quarkiverse.cxf.it.server.FruitServiceImpl quarkus.cxf.endpoint."/fruits".features = org.apache.cxf.ext.logging.LoggingFeature
quarkus.cxf.endpoint."/fruits".implementor = io.quarkiverse.cxf.it.server.FruitServiceImpl
quarkus.cxf.endpoint."/fruits".features = org.apache.cxf.ext.logging.LoggingFeature
5.1.7.4. Test with Quarkus dev mode and curl Copy linkLink copied to clipboard!
Having the above files in place, you can start Quarkus tooling in dev mode:
mvn quarkus:dev ... INFO [io.quarkus] (Quarkus Main Thread) ... Listening on: http://localhost:8080
$ mvn quarkus:dev
...
INFO [io.quarkus] (Quarkus Main Thread) ... Listening on: http://localhost:8080
and then check whether the service is working by invoking its list operation:
As you can see, the endpoint has returned the two fruits Apple and Pineapple available by default.
Now let’s add another fruit, say an Orange:
We can see Orange having been added in the returned list as expected.
5.1.7.5. Further steps Copy linkLink copied to clipboard!
You may want to proceed with packaging your application for running on a JVM or natively.
5.1.8. Contract first and code first approaches Copy linkLink copied to clipboard!
Both contract first and code first development modes are fully supported by Quarkus CXF.
5.1.8.1. Contract first client Copy linkLink copied to clipboard!
A SOAP service is described by WSDL. It is a contract defining operations, their parameters and return values, etc. WSDL is rich enough to be used for generating the code of a complete client. CXF provides the wsdl2java utility for that.
Quarkus CXF wraps wsdl2java in the quarkus-cxf extension so you do not need to use it directly.
Follow the Generate the Model classes from WSDL section of the user guide for more details about how to use it.
You may also want to check the CXF Developing a Consumer as a general introduction.
5.1.8.2. Contract first service Copy linkLink copied to clipboard!
When implementing a service the generation of Java code from WSDL may also come in handy. wsdl2java can generate the model classes (with JAXB annotations) and service interfaces (with JAX-WS annotations) for you. Your task is then to provide implementations for those interfaces.
You may want to check the WSDL First Service Development section of CXF documentation for a better understanding of the underlying concepts.
5.1.8.3. Code first service Copy linkLink copied to clipboard!
Another valid option at your disposal is to write your service in Java, using JAX-WS and JAXB. Then you have two options how to obtain the WSDL contract:
-
Start your service and point your clients at
http://your-host/your-service?wsdl - Generate the WSDL document from Java classes at build time
Check the Code first development section of CXF documentation for further information.
5.1.8.4. Generate the Model classes from WSDL Copy linkLink copied to clipboard!
quarkus-cxf extension supports generating Java classes from WSDL during Quarkus code generation phase.
The code snippets shown in this section come from the client integration test in the source tree of Quarkus CXF. You may want to check it as an executable example.
You need to set up a couple of things for CXF code generation to work:
-
Have
io.quarkiverse.cxf:quarkus-cxfdependency in your project For Maven projects, the
generate-codegoal needs to be present in the configuration ofquarkus-maven-plugin:pom.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
For Gradle projects no additional configurarion of
io.quarkusplugin is needed -
Put your WSDL files under
src/main/resourcesorsrc/test/resourcesor any subdirectory thereof. -
Your WSDL file names must end with
.wsdl Set
quarkus.cxf.codegen.wsdl2java.includesconfiguration property to a pattern matching the WSDL files you wish to process. If you want to process all WSDL files undersrc/main/resources/wsdlorsrc/test/resources/wsdl, set it as follows:application.properties
quarkus.cxf.codegen.wsdl2java.includes = wsdl/*.wsdl
quarkus.cxf.codegen.wsdl2java.includes = wsdl/*.wsdlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
This will generate Java classes in target/generated-sources/wsdl2java or target/generated-test-sources/wsdl2java directory. They will be automatically picked by the compiler plugin there. Hence we are free to refer to them from our application or test code.
Note that quarkus-cxf code generation uses the wsdl2Java utility from CXF under the hood. wsdl2Java is called separately for each WSDL file selected by includes and excludes.
Passing custom parameters to wsdl2java is possible through quarkus.cxf.codegen.wsdl2java.additional-params configuration parameter.
If you need different additional-params for each WSDL file, you may want to define a separate named parameter set for each one of them. Here is an example:
application.properties
Add io.quarkiverse.cxf:quarkus-cxf-xjc-plugins dependency to your project to be able to use -xjc-Xbg, -xjc-Xdv, -xjc-Xjavadoc, -xjc-Xproperty-listener, -xjc-Xts and -xjc-Xwsdlextension wsdl2java parameters.
5.1.8.4.1. Non ASCII Characters Copy linkLink copied to clipboard!
Sometimes the wsdl2java autogenerated Java classes may not be fully compatible with GraalVM due to non ASCII characters getting included in the code. Similar exceptions to the below may appear during native image builds.
[quarkus-dalkia-ticket-loader-1.0.0-SNAPSHOT-runner:26] compile: 161 459,15 ms, 8,54 GB
[quarkus-dalkia-ticket-loader-1.0.0-SNAPSHOT-runner:26] image: 158 272,73 ms, 8,43 GB
[quarkus-dalkia-ticket-loader-1.0.0-SNAPSHOT-runner:26] write: 205,82 ms, 8,43 GB
Fatal error:com.oracle.svm.core.util.VMError$HostedError: java.lang.RuntimeException: oops : expected ASCII string! com.oracle.svm.reflect.OperationOrderStatusType_CRÉÉ_f151156b0d42ecdbdfb919501d8a86dda8733012_1456.hashCode
at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:72)
[quarkus-dalkia-ticket-loader-1.0.0-SNAPSHOT-runner:26] compile: 161 459,15 ms, 8,54 GB
[quarkus-dalkia-ticket-loader-1.0.0-SNAPSHOT-runner:26] image: 158 272,73 ms, 8,43 GB
[quarkus-dalkia-ticket-loader-1.0.0-SNAPSHOT-runner:26] write: 205,82 ms, 8,43 GB
Fatal error:com.oracle.svm.core.util.VMError$HostedError: java.lang.RuntimeException: oops : expected ASCII string! com.oracle.svm.reflect.OperationOrderStatusType_CRÉÉ_f151156b0d42ecdbdfb919501d8a86dda8733012_1456.hashCode
at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:72)
Below is an example of auto-generated non ASCII characters in a Java class:
Anything starting with \u will be a problem. Consequently the following refactoring is needed:
5.1.8.5. Generate WSDL document from Java Copy linkLink copied to clipboard!
If the WSDL served by your service at http://your-host/your-service?wsdl is not enough because you e.g. want to distribute it as a Maven artifact, then you can use java2ws to generate the WSDL document at build time.
You do not need to invoke the java2ws tool provided by CXF directly, neither you have to use the cxf-java2ws-plugin.
quarkus-cxf wraps java2ws and so you can configure it in application.properties as any other aspect of your application.
Here is an example:
The sample code snippets used in this section come from the server integration test in the source tree of Quarkus CXF
application.properties
quarkus.cxf.java2ws.includes = io.quarkiverse.cxf.it.server.HelloServiceImpl,io.quarkiverse.cxf.it.server.FaultyHelloServiceImpl quarkus.cxf.java2ws.wsdl-name-template = %TARGET_DIR%/Java2wsTest/%SIMPLE_CLASS_NAME%-from-java2ws.wsdl
quarkus.cxf.java2ws.includes = io.quarkiverse.cxf.it.server.HelloServiceImpl,io.quarkiverse.cxf.it.server.FaultyHelloServiceImpl
quarkus.cxf.java2ws.wsdl-name-template = %TARGET_DIR%/Java2wsTest/%SIMPLE_CLASS_NAME%-from-java2ws.wsdl
Here we have instructed java2ws to generate WSDLs for two service classes, namely HelloServiceImpl and FaultyHelloServiceImpl.
The service classes must be annotated with jakarta.xml.ws.WebService to be selected for java2ws processing.
The two generated WSDL documents will be stored as target/Java2wsTest/FaultyHelloServiceImpl-from-java2ws.wsdl and target/Java2wsTest/HelloServiceImpl-from-java2ws.wsdl respectively.
Unlike wsdl2java which is executed within Quarkus source generation phase, java2ws is a part Quarkus augmentation that happens after compilation. The input of java2ws are, after all, Java class files. Hence you do not need to add <goal>generate-code</goal> to quarkus-maven-plugin for java2ws.
5.1.8.5.1. See also Copy linkLink copied to clipboard!
-
quarkus.cxf.java2ws.*configuration properties ofquarkus-cxf
5.1.9. CXF Interceptors and Features, JAX-WS Handlers Copy linkLink copied to clipboard!
Check the following chapters to learn a bout various ways to customize the processing of SOAP requests and responses:
5.1.9.1. CXF Interceptors and Features Copy linkLink copied to clipboard!
CXF interceptors and CXF features can be added to both your client or server using either annotations or application.properties configurations.
While CXF provides a number of out of the box embedded interceptors and features, you can also integrate your custom developed implementations.
Annotations can be used on either the service interface or implementor classes.
You may also define your configurations in the application.properties file.
quarkus.cxf.endpoint."/greeting-service".features=org.apache.cxf.ext.logging.LoggingFeature quarkus.cxf.endpoint."/greeting-service".in-interceptors=org.acme.Test1Interceptor quarkus.cxf.endpoint."/greeting-service".out-interceptors=org.acme.Test1Interceptor quarkus.cxf.endpoint."/greeting-service".in-fault-interceptors=org.acme.Test2Interceptor,org.acme.Test3Intercetpor quarkus.cxf.endpoint."/greeting-service".out-fault-interceptors=org.acme.Test1Intercetpor
quarkus.cxf.endpoint."/greeting-service".features=org.apache.cxf.ext.logging.LoggingFeature
quarkus.cxf.endpoint."/greeting-service".in-interceptors=org.acme.Test1Interceptor
quarkus.cxf.endpoint."/greeting-service".out-interceptors=org.acme.Test1Interceptor
quarkus.cxf.endpoint."/greeting-service".in-fault-interceptors=org.acme.Test2Interceptor,org.acme.Test3Intercetpor
quarkus.cxf.endpoint."/greeting-service".out-fault-interceptors=org.acme.Test1Intercetpor
Both feature and interceptor classes are loaded via CDI first. They can be referenced by fully a qualified class name or by a bean name.
If no CDI beans are available, the constructor without parameters will be invoked to instantiate each class.
5.1.9.2. JAX-WS Handlers Copy linkLink copied to clipboard!
As an alternative to the @HandlerChain annotation, JAX-WS Handlers can be added to both your client or server via application.properties:
application.properties
# A web service endpoint with multiple Handler classes quarkus.cxf.endpoint."/greeting-service".handlers=org.acme.MySOAPHandler,org.acme.AnotherSOAPHandler # A web service client with a single Handler quarkus.cxf.client."greeting-client".handlers=org.acme.MySOAPHandler
# A web service endpoint with multiple Handler classes
quarkus.cxf.endpoint."/greeting-service".handlers=org.acme.MySOAPHandler,org.acme.AnotherSOAPHandler
# A web service client with a single Handler
quarkus.cxf.client."greeting-client".handlers=org.acme.MySOAPHandler
Where MySOAPHandler could look like below:
The SOAPHandler classes are loaded via CDI first..
If no CDI beans are available, the constructor without parameters will be invoked to instantiate each class.
5.1.10. Advanced service topics Copy linkLink copied to clipboard!
Check the following chapters for more details about implementing SOAP service endpoints:
5.1.10.1. Service endpoints and paths Copy linkLink copied to clipboard!
Let’s explain how a service endpoint can be exposed under a certain URL path.
5.1.10.1.1. Set the endpoint path via application.properties Copy linkLink copied to clipboard!
In the First SOAP Web service chapter, we explained how to expose a service using application.properties:
application.properties
With this setup in place, the io.quarkiverse.cxf.it.server.HelloServiceImpl will be accessible under http://localhost:8080/soap/hello.
This is the traditional way that worked since the very beginning of Quarkus CXF.
5.1.10.1.2. Set the endpoint path using @CXFEndpoint annotation Copy linkLink copied to clipboard!
Since Quarkus CXF 3.11.0, there is a new way to expose an endpoint under a specific path: the @io.quarkiverse.cxf.annotation.CXFEndpoint annotation. The path is set through its non-optional attribute value and it is relative to quarkus.cxf.path much like when this is done via application.properties.
Let’s have a look at an example.
The sample code snippet shown in this section comes from the Client and server integration test in the source tree of Quarkus CXF. You may want to use it as a runnable example.
PathAnnotationHelloServiceImpl.java
- 1
- If the value of
quarkus.cxf.pathinapplication.propertiesis/soap, then this service will be accessible underhttp://localhost:8080/soap/path-annotation.
@CXFEndpoint("/my-path") annotation on MyServiceImpl type is equivalent to the quarkus.cxf.endpoint."/my-path".implementor = org.acme.MyServiceImpl line in application.properties. Therefore it is enough to use just one of them.
Other options set in application.properties for the /my-path endpoint will combine just fine with @CXFEndpoint("/my-path").
5.1.10.1.2.1. Use the @CXFEndpoint annotation on producer methods Copy linkLink copied to clipboard!
The @CXFEndpoint annotation can also be used on producer methods. This comes in handy especially when testing clients, because the returned implementation can be a mock.
Here is an example:
MockedEndpointTest.java
- 1
- Here we use the
@CXFEndpointannotation on a method that returns a mock of theHelloServiceinterface. The@jakarta.enterprise.inject.Producesannotation is not required, because Quarkus CXF declares@CXFEndpointas a bean defining annotation. - 2
- The client is configured in
application.propertiesto connect tohttp://localhost:8080/soap/helloMock - 3
- The assertion makes sure that the service implementation works as expected.
5.1.10.2. JAX-WS Providers Copy linkLink copied to clipboard!
JAX-WS Providers are fully supported, and can be implemented as shown below.
Given the following sample Provider implementation:
The application.properties can be configured as shown below.
# A web service endpoint with the Provider implementation class quarkus.cxf.endpoint."/stream-source".implementor=org.acme.StreamSourcePayloadProvider
# A web service endpoint with the Provider implementation class
quarkus.cxf.endpoint."/stream-source".implementor=org.acme.StreamSourcePayloadProvider
Provider classes are loaded via CDI first..
If no CDI beans are available, the constructor without parameters will be invoked to instantiate each class.
5.1.10.3. REST and SOAP Endpoints Copy linkLink copied to clipboard!
Sometimes a REST endpoint may be needed in the same project where the Quarkus CXF Extension is used. The REST endpoint path must be different from the SOAP endpoint path (in order to avoid request forwarding conflicts between both protocols).
For example, if a WeatherWebService interface is declared in a WSDL, you can begin by creating the org.acme.cxf.WeatherWebServiceImpl class as follows:
After that, you would need to specify the root context for your CXF web services, as indicated in the configuration documentation to split the REST (with RESTEasy for example) and SOAP routes based on their root context paths.
CXF’s SOAP properties:
quarkus.cxf.path=/soap quarkus.cxf.endpoint."/weather".implementor=org.acme.cxf.WeatherWebServiceImpl
quarkus.cxf.path=/soap
quarkus.cxf.endpoint."/weather".implementor=org.acme.cxf.WeatherWebServiceImpl
Now, imagine the following RESTEasy endpoint:
You can separate your REST endpoint by configuring the REASTEasy path:
quarkus.resteasy.path=/rest
quarkus.resteasy.path=/rest
You should now be able to send requests to both your REST and SOAP endpoints deployed within a single project, at:
- http://localhost:8080/rest/healthcheck for REST
- http://localhost:8080/soap/weather for SOAP
5.1.10.4. Running behind a reverse proxy Copy linkLink copied to clipboard!
SOAP requests aimed towards services running on Quarkus can be routed through proxies that generate additional headers (e.g. X-Forwarded-Host) to keep information from the client-facing side of the proxy servers that is altered or lost when they are involved. In those scenarios, Quarkus can be configured to automatically update information like protocol, host, port and URI reflecting the values in these headers.
Refer to Quarkus HTTP reference for more details.
Quarkus CXF support for various X-Forwarded headers works in line with Quarkus configuration.
Activating this feature leaves the server exposed to several security issues (i.e. information spoofing). Consider activating it only when running behind a reverse proxy.
These are the relevant Quarkus properties and their effect on Quarkus CXF:
quarkus.http.proxy.proxy-address-forwarding- the main switch to enable the rewriting of the request destination parts.- If enabled, the rewriting of the request fields will be effective throughout the whole CXF server stack.
-
If enabled, the values passed via
X-Forwarded-ProtoandX-Forwarded-Portheaders will be used to set the protocol part and the port part of the URL returned byjakarta.servlet.http.HttpServletRequest.getRequestURL()respectively. -
If enabled, the value passed via
X-Forwarded-Forwill be returned byjakarta.servlet.ServletRequest.getRemoteAddr().
-
quarkus.http.proxy.enable-forwarded-host- enable the rewriting of the host part of URL returned byjakarta.servlet.http.HttpServletRequest.getRequestURL(). The actual host name is taken from the header configured viaquarkus.http.proxy.forwarded-host-header(default isX-Forwarded-Host). -
quarkus.http.proxy.enable-forwarded-prefix- enable the rewriting of the path part of the URL returned byjakarta.servlet.http.HttpServletRequest.getRequestURL()and of the URI returned byjakarta.servlet.http.HttpServletRequest.getRequestURI(). The actual path prefix is taken from the header configured viaquarkus.http.proxy.forwarded-prefix-header(default isX-Forwarded-Prefix).
Here is the most common snippet to copy to your application.properties:
quarkus.http.proxy.proxy-address-forwarding = true quarkus.http.proxy.enable-forwarded-host = true quarkus.http.proxy.enable-forwarded-prefix = true
quarkus.http.proxy.proxy-address-forwarding = true
quarkus.http.proxy.enable-forwarded-host = true
quarkus.http.proxy.enable-forwarded-prefix = true
One of the observable effects of these settings is the change of the location value in WSDL served on http://localhost:8080/services/my-service?wsdl. For example, if the request contains the following headers
X-Forwarded-Proto: https X-Forwarded-Host: api.example.com X-Forwarded-Port: 443 X-Forwarded-Prefix: /my-prefix
X-Forwarded-Proto: https
X-Forwarded-Host: api.example.com
X-Forwarded-Port: 443
X-Forwarded-Prefix: /my-prefix
then the WSDL served on http://localhost:8080/services/my-service?wsdl would contain the following location:
... <soap:address location="https://api.example.com:443/my-prefix/services/my-service"/> ...
...
<soap:address location="https://api.example.com:443/my-prefix/services/my-service"/>
...
5.1.11. Advanced SOAP client topics Copy linkLink copied to clipboard!
Check the following chapters for more details about implementing SOAP clients:
5.1.11.1. client-endpoint-url defaults Copy linkLink copied to clipboard!
If you omit the client-endpoint-url property in application.properties, the CXF Quarkus extension will assume that the service is published at http://localhost:8080/{service-path}, where {service-path} is derived from
-
Configuration property
quarkus.cxf.path(if specified); and the - SEI’s class name in lower case
Given quarkus.cxf.path = /ws, the default effective client-endpoint-url of the CalculatorService would be http://localhost:8080/ws/org.jboss.eap.quickstarts.wscalculator.calculator.calculatorservice.
If quarkus.cxf.path is not specified, the client-endpoint-url would be just http://localhost:8080/org.jboss.eap.quickstarts.wscalculator.calculator.calculatorservice.
5.1.11.2. Configure multiple clients Copy linkLink copied to clipboard!
In the example above, we configured just a single client called myCalculator. Of course, you can configure multiple clients pointing at different URLs and/or implementing different SEIs using multiple identifiers:
application.properties
5.1.11.3. CDI scope of clients injected via @CXFClient Copy linkLink copied to clipboard!
Quarkus CXF produces all clients injected via @io.quarkiverse.cxf.annotation.CXFClient in the default @Dependent scope. Due to that, the real scope of the injected instance depends on the CDI scope of the bean into which the client is injected.
Therefore, if the client is injected into an @ApplicationScoped bean, then the client instance also becomes @ApplicationScoped. If the client is injected into an @RequestScoped bean, then the client instance also becomes @RequestScoped.
This behavior comes in handy if you need to configure clients dynamically after the application was started.
5.1.11.4. Programmatic client configuration at startup Copy linkLink copied to clipboard!
To configure all clients at application startup, you can implement an HTTPConduitConfigurer and set it on the CXF Bus in an StartupEvent observer method.
In the example snippet below, we configure some aspects of the HTTPClientPolicy. The same approach can be leveraged to customize also AuthorizationPolicy, ProxyAuthorizationPolicy or even TLSClientParameters of your clients.
5.1.11.5. Dynamic client configuration Copy linkLink copied to clipboard!
Sometimes you need to reconfigure the client after the application has been started, or even before every request. This might be the case, if, for example, each request needs to be sent to a different remote URL.
CXF offers an API to set the URL of the remote endpoint. However using that API on a client instance that may be accessed from other threads can lead to race conditions.
5.1.11.5.1. Preventing concurrent access to a CXF client Copy linkLink copied to clipboard!
If your client is used as a part of serving an external request, you can inject the client into a @RequestScoped bean. Then every request will be served by a fresh client instance and you can configure it safely.
For example, this solution is applicable when your client is called from a REST-handler method (see below) or from a @WebMethod that are serving external requests.
5.1.11.6. Pure client applications Copy linkLink copied to clipboard!
Quarkus batch (e.g. periodically scheduled), or command line applications, may do without an HTTP server. Use the property below to prevent launching the HTTP server at startup:
quarkus.http.host-enabled = false
quarkus.http.host-enabled = false
5.1.11.7. Prevent resource leaks Copy linkLink copied to clipboard!
CXF client proxies implement java.io.Closeable. Therefore, it is important to call ((Closeable) proxy).close() once the client is not needed anymore to free all associated system resources, such as threads.
Quarkus CXF takes care for closing the clients injected via @io.quarkiverse.cxf.annotation.CXFClient automatically as soon as they are disposed by the CDI container.
For client proxies created manually, it is up to you to call ((Closeable) proxy).close():
5.1.12. Camel Integration Copy linkLink copied to clipboard!
Camel Quarkus supports CXF since its version 2.12.0. Under the hood, the implementation is based on Quarkus CXF. Therefore, all functionality available in Quarkus CXF is also available in Camel Quarkus.
Refer to Camel Quarkus CXF SOAP extension documentation for further details.
5.1.13. Examples Copy linkLink copied to clipboard!
The integration-tests folder of the codebase provides various examples that demonstrate how to use this extension extensively.
Chapter 6. Quarkus CXF security guide Copy linkLink copied to clipboard!
This chapter provides information about security when working with Quarkus CXF extensions.
6.1. Security guide Copy linkLink copied to clipboard!
The security guide documents various security related aspects of Quarkus CXF:
6.1.1. SSL, TLS and HTTPS Copy linkLink copied to clipboard!
This section documents various use cases related to SSL, TLS and HTTPS.
The sample code snippets used in this section come from the WS-SecurityPolicy integration test in the source tree of Quarkus CXF
6.1.1.1. Client SSL configuration Copy linkLink copied to clipboard!
If your client is going to communicate with a server whose SSL certificate is not trusted by the client’s operating system, then you need to set up a custom trust store for your client.
Tools like openssl or Java keytool are commonly used for creating and maintaining truststores.
We have examples for both tools in the Quarkus CXF source tree:
Once you have prepared the trust store, you need to configure your client to use it.
6.1.1.1.1. Set the client trust store in application.properties Copy linkLink copied to clipboard!
This is the easiest way to set the client trust store. The key role is played by the following properties:
Here is an example:
application.properties
- 1
pkcs12andjksare two commonly used keystore formats. PKCS12 is the default Java keystore format since Java 9. We recommend using PKCS12 rather than JKS, because it offers stronger cryptographic algorithms, it is extensible, standardized, language-neutral and widely supported.- 2
- The referenced
client-truststore.pkcs12file has to be available either in the classpath or in the file system.
6.1.1.2. Server SSL configuration Copy linkLink copied to clipboard!
To make your services available over the HTTPS protocol, you need to set up server keystore in the first place. The server SSL configuration is driven by Vert.x, the HTTP layer of Quarkus. Quarkus HTTP guide provides the information about the configuration options.
Here is a basic example:
application.properties
# Server side SSL quarkus.tls.key-store.p12.path = localhost-keystore.pkcs12 quarkus.tls.key-store.p12.password = localhost-keystore-password quarkus.tls.key-store.p12.alias = localhost quarkus.tls.key-store.p12.alias-password = localhost-keystore-password
# Server side SSL
quarkus.tls.key-store.p12.path = localhost-keystore.pkcs12
quarkus.tls.key-store.p12.password = localhost-keystore-password
quarkus.tls.key-store.p12.alias = localhost
quarkus.tls.key-store.p12.alias-password = localhost-keystore-password
6.1.1.3. Mutual TLS (mTLS) authentication Copy linkLink copied to clipboard!
So far, we have explained the simple or single-sided case where only the server proves its identity through an SSL certificate and the client has to be set up to trust that certificate. Mutual TLS authentication goes by letting also the client prove its identity using the same means of public key cryptography.
Hence, for the Mutual TLS (mTLS) authentication, in addition to setting up the server keystore and client truststore as described above, you need to set up the keystore on the client side and the truststore on the server side.
The tools for creating and maintaining the stores are the same and the configuration properties to use are pretty much analogous to the ones used in the Simple TLS case.
The mTLS integration test in the Quarkus CXF source tree can serve as a good starting point.
The keystores and truststores are created with openssl (or alternatively with Java Java keytool)
Here is the application.properties file:
application.properties
6.1.1.4. Enforce SSL through WS-SecurityPolicy Copy linkLink copied to clipboard!
The requirement for the clients to connect through HTTPS can be defined in a policy.
The functionality is provided by quarkus-cxf-rt-ws-security extension.
Here is an example of a policy file:
https-policy.xml
The policy has to be referenced from a service endpoint interface (SEI):
HttpsPolicyHelloService.java
With this setup in place, any request delivered over HTTP will be rejected by the PolicyVerificationInInterceptor:
ERROR [org.apa.cxf.ws.pol.PolicyVerificationInInterceptor] Inbound policy verification failed: These policy alternatives can not be satisfied:
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}TransportBinding: TLS is not enabled
...
ERROR [org.apa.cxf.ws.pol.PolicyVerificationInInterceptor] Inbound policy verification failed: These policy alternatives can not be satisfied:
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}TransportBinding: TLS is not enabled
...
6.1.2. Authentication and authorization Copy linkLink copied to clipboard!
The sample code snippets shown in this section come from the Client and server integration test in the source tree of Quarkus CXF. You may want to use it as a runnable example.
6.1.2.1. Client HTTP basic authentication Copy linkLink copied to clipboard!
Use the following client configuration options provided by quarkus-cxf extension to pass the username and password for HTTP basic authentication:
Here is an example:
application.properties
quarkus.cxf.client.basicAuth.wsdl = http://localhost:${quarkus.http.test-port}/soap/basicAuth?wsdl
quarkus.cxf.client.basicAuth.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/basicAuth
quarkus.cxf.client.basicAuth.username = bob
quarkus.cxf.client.basicAuth.password = bob234
quarkus.cxf.client.basicAuth.wsdl = http://localhost:${quarkus.http.test-port}/soap/basicAuth?wsdl
quarkus.cxf.client.basicAuth.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/basicAuth
quarkus.cxf.client.basicAuth.username = bob
quarkus.cxf.client.basicAuth.password = bob234
6.1.2.1.1. Accessing WSDL protected by basic authentication Copy linkLink copied to clipboard!
By default, the clients created by Quarkus CXF do not send the Authorization header, unless you set the quarkus.cxf.client."client-name".secure-wsdl-access to true:
application.properties
quarkus.cxf.client.basicAuthSecureWsdl.wsdl = http://localhost:${quarkus.http.test-port}/soap/basicAuth?wsdl
quarkus.cxf.client.basicAuthSecureWsdl.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/basicAuthSecureWsdl
quarkus.cxf.client.basicAuthSecureWsdl.username = bob
quarkus.cxf.client.basicAuthSecureWsdl.password = ${client-server.bob.password}
quarkus.cxf.client.basicAuthSecureWsdl.secure-wsdl-access = true
quarkus.cxf.client.basicAuthSecureWsdl.wsdl = http://localhost:${quarkus.http.test-port}/soap/basicAuth?wsdl
quarkus.cxf.client.basicAuthSecureWsdl.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/basicAuthSecureWsdl
quarkus.cxf.client.basicAuthSecureWsdl.username = bob
quarkus.cxf.client.basicAuthSecureWsdl.password = ${client-server.bob.password}
quarkus.cxf.client.basicAuthSecureWsdl.secure-wsdl-access = true
6.1.2.2. Mutual TLS (mTLS) authentication Copy linkLink copied to clipboard!
See the Mutual TLS (mTLS) authentication section in SSL, TLS and HTTPS guide.
6.1.2.3. Securing service endpoints Copy linkLink copied to clipboard!
The server-side authentication and authorization is driven by Quarkus Security, especially when it comes to
There is a basic example in our Client and server integration test. Its key parts are:
-
io.quarkus:quarkus-elytron-security-properties-filedependency as an Identity provider Basic authentication enabled and users with their roles configured in
application.properties:application.properties
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Role-based access control enfoced via
@RolesAllowedannotation:
BasicAuthHelloServiceImpl.java
6.1.3. Authentication enforced by WS-SecurityPolicy Copy linkLink copied to clipboard!
You can enforce authentication through WS-SecurityPolicy, instead of Mutual TLS and Basic HTTP authentication for clients and services.
To enforce authentication through WS-SecurityPolicy, follow these steps:
- Add a supporting tokens policy to an endpoint in the WSDL contract.
-
On the server side, implement an authentication callback handler and associate it with the endpoint in
application.propertiesor via environment variables. Credentials received from clients are authenticated by the callback handler. -
On the client side, provide credentials through either configuration in
application.propertiesor environment variables. Alternatively, you can implement an authentication callback handler to pass the credentials.
6.1.3.1. Specifying an Authentication Policy Copy linkLink copied to clipboard!
If you want to enforce authentication on a service endpoint, associate a supporting tokens policy assertion with the relevant endpoint binding and specify one or more token assertions under it.
There are several different kinds of supporting tokens policy assertions, whose XML element names all end with SupportingTokens (for example, SupportingTokens, SignedSupportingTokens, and so on). For a complete list, see the Supporting Tokens section of the WS-SecurityPolicy specification.
6.1.3.2. UsernameToken policy assertion example Copy linkLink copied to clipboard!
The sample code snippets used in this section come from the WS-SecurityPolicy integration test in the source tree of Quarkus CXF. You may want to use it as a runnable example.
The following listing shows an example of a policy that requires a WS-Security UsernameToken (which contains username/password credentials) to be included in the security header.
username-token-policy.xml
There are two ways how you can associate this policy file with a service endpoint:
Reference the policy on the Service Endpoint Interface (SEI) like this:
UsernameTokenPolicyHelloService.java
@WebService(serviceName = "UsernameTokenPolicyHelloService") @Policy(placement = Policy.Placement.BINDING, uri = "username-token-policy.xml") public interface UsernameTokenPolicyHelloService extends AbstractHelloService { ... }@WebService(serviceName = "UsernameTokenPolicyHelloService") @Policy(placement = Policy.Placement.BINDING, uri = "username-token-policy.xml") public interface UsernameTokenPolicyHelloService extends AbstractHelloService { ... }Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Include the policy in your WSDL contract and reference it via
PolicyReferenceelement.
When you have the policy in place, configure the credentials on the service endpoint and the client:
application.properties
In the above listing, usernameTokenPasswordCallback is a name of a @jakarta.inject.Named bean implementing javax.security.auth.callback.CallbackHandler. Quarkus CXF will lookup a bean with this name in the CDI container.
Here is an example implementation of the bean:
UsernameTokenPasswordCallback.java
To test the whole setup, you can create a simple @QuarkusTest:
UsernameTokenTest.java
When running the test via mvn test -Dtest=UsernameTokenTest, you should see a SOAP message being logged with a Security header containing Username and Password:
Log output of the UsernameTokenTest
6.1.3.3. SAML v1 and v2 policy assertion examples Copy linkLink copied to clipboard!
The WS-SecurityPolicy integration test contains also analogous examples with SAML v1 and SAML v2 assertions.
Chapter 7. Camel Security Copy linkLink copied to clipboard!
This chapter provides information about Camel route security options.
7.1. Camel security overview Copy linkLink copied to clipboard!
Camel offers several forms & levels of security capabilities that can be utilized on Camel routes. These various forms of security may be used in conjunction with each other or separately.
The broad categories offered are:
- Route Security - Authentication and Authorization services to proceed on a route or route segment
- Payload Security - Data Formats that offer encryption/decryption services at the payload level
- Endpoint Security - Security offered by components that can be utilized by endpointUri associated with the component
- Configuration Security - Security offered by encrypting sensitive information from configuration files or external Secured Vault systems.
Camel offers the JSSE Utility for configuring SSL/TLS related aspects of a number of Camel components.
7.2. Route Security Copy linkLink copied to clipboard!
Authentication and Authorization Services
Camel offers Route Policy driven security capabilities that may be wired into routes or route segments. A route policy in Camel utilizes a strategy pattern for applying interceptors on Camel Processors. It’s offering the ability to apply cross-cutting concerns (for example. security, transactions etc) of a Camel route.
7.3. Payload Security Copy linkLink copied to clipboard!
Camel offers encryption/decryption services to secure payloads or selectively apply encryption/decryption capabilities on portions/sections of a payload.
The dataformats offering encryption/decryption of payloads utilizing Marshal are:
7.4. Endpoint Security Copy linkLink copied to clipboard!
Some components in Camel offer an ability to secure their endpoints (using interceptors etc) and therefore ensure that they offer the ability to secure payloads as well as provide authentication/authorization capabilities at endpoints created using the components.
7.5. Configuration Security Copy linkLink copied to clipboard!
Camel offers the Properties component to externalize configuration values to properties files. Those values could contain sensitive information such as usernames and passwords.
Those values can be encrypted and automatic decrypted by Camel using:
Camel also support accessing the secured configuration from an external vault systems.
7.5.1. Configuration Security using Vaults Copy linkLink copied to clipboard!
The following Vaults are supported by Camel:
7.5.1.1. Using AWS Vault Copy linkLink copied to clipboard!
To use AWS Secrets Manager you need to provide accessKey, secretKey and the region. This can be done using environmental variables before starting the application:
export $CAMEL_VAULT_AWS_ACCESS_KEY=accessKey export $CAMEL_VAULT_AWS_SECRET_KEY=secretKey export $CAMEL_VAULT_AWS_REGION=region
export $CAMEL_VAULT_AWS_ACCESS_KEY=accessKey
export $CAMEL_VAULT_AWS_SECRET_KEY=secretKey
export $CAMEL_VAULT_AWS_REGION=region
You can also configure the credentials in the application.properties file such as:
camel.vault.aws.accessKey = accessKey camel.vault.aws.secretKey = secretKey camel.vault.aws.region = region
camel.vault.aws.accessKey = accessKey
camel.vault.aws.secretKey = secretKey
camel.vault.aws.region = region
If you want instead to use the AWS default credentials provider, you’ll need to provide the following env variables:
export $CAMEL_VAULT_AWS_USE_DEFAULT_CREDENTIALS_PROVIDER=true export $CAMEL_VAULT_AWS_REGION=region
export $CAMEL_VAULT_AWS_USE_DEFAULT_CREDENTIALS_PROVIDER=true
export $CAMEL_VAULT_AWS_REGION=region
You can also configure the credentials in the application.properties file such as:
camel.vault.aws.defaultCredentialsProvider = true camel.vault.aws.region = region
camel.vault.aws.defaultCredentialsProvider = true
camel.vault.aws.region = region
It is also possible to specify a particular profile name for accessing AWS Secrets Manager
export $CAMEL_VAULT_AWS_USE_PROFILE_CREDENTIALS_PROVIDER=true export $CAMEL_VAULT_AWS_PROFILE_NAME=test-account export $CAMEL_VAULT_AWS_REGION=region
export $CAMEL_VAULT_AWS_USE_PROFILE_CREDENTIALS_PROVIDER=true
export $CAMEL_VAULT_AWS_PROFILE_NAME=test-account
export $CAMEL_VAULT_AWS_REGION=region
You can also configure the credentials in the application.properties file such as:
camel.vault.aws.profileCredentialsProvider = true camel.vault.aws.profileName = test-account camel.vault.aws.region = region
camel.vault.aws.profileCredentialsProvider = true
camel.vault.aws.profileName = test-account
camel.vault.aws.region = region
At this point you’ll be able to reference a property in the following way by using aws: as prefix in the {{ }} syntax:
Where route will be the name of the secret stored in the AWS Secrets Manager Service.
You could specify a default value in case the secret is not present on AWS Secret Manager:
In this case if the secret doesn’t exist, the property will fallback to "default" as value.
Also, you are able to get particular field of the secret, if you have for example a secret named database of this form:
You’re able to do get single secret value in your route, like for example:
Or re-use the property as part of an endpoint.
You could specify a default value in case the particular field of secret is not present on AWS Secret Manager:
In this case if the secret doesn’t exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value.
For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done.
The only requirement is adding camel-aws-secrets-manager JAR to your Camel application.
7.5.1.2. Using Google Secret Manager GCP Vault Copy linkLink copied to clipboard!
To use GCP Secret Manager you need to provide serviceAccountKey file and GCP projectId. This can be done using environmental variables before starting the application:
export $CAMEL_VAULT_GCP_SERVICE_ACCOUNT_KEY=file:////path/to/service.accountkey export $CAMEL_VAULT_GCP_PROJECT_ID=projectId
export $CAMEL_VAULT_GCP_SERVICE_ACCOUNT_KEY=file:////path/to/service.accountkey
export $CAMEL_VAULT_GCP_PROJECT_ID=projectId
You can also configure the credentials in the application.properties file such as:
camel.vault.gcp.serviceAccountKey = accessKey camel.vault.gcp.projectId = secretKey
camel.vault.gcp.serviceAccountKey = accessKey
camel.vault.gcp.projectId = secretKey
If you want instead to use the GCP default client instance, you’ll need to provide the following env variables:
export $CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE=true export $CAMEL_VAULT_GCP_PROJECT_ID=projectId
export $CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE=true
export $CAMEL_VAULT_GCP_PROJECT_ID=projectId
You can also configure the credentials in the application.properties file such as:
camel.vault.gcp.useDefaultInstance = true camel.vault.aws.projectId = region
camel.vault.gcp.useDefaultInstance = true
camel.vault.aws.projectId = region
At this point you’ll be able to reference a property in the following way by using gcp: as prefix in the {{ }} syntax:
Where route will be the name of the secret stored in the GCP Secret Manager Service.
You could specify a default value in case the secret is not present on GCP Secret Manager:
In this case if the secret doesn’t exist, the property will fallback to "default" as value.
Also, you are able to get particular field of the secret, if you have for example a secret named database of this form:
You’re able to do get single secret value in your route, like for example:
Or re-use the property as part of an endpoint.
You could specify a default value in case the particular field of secret is not present on GCP Secret Manager:
In this case if the secret doesn’t exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value.
For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done.
There are only two requirements: - Adding camel-google-secret-manager JAR to your Camel application. - Give the service account used permissions to do operation at secret management level (for example accessing the secret payload, or being admin of secret manager service)
7.5.1.3. Using Azure Key Vault Copy linkLink copied to clipboard!
To use this function you’ll need to provide credentials to Azure Key Vault Service as environment variables:
export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId
export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId
export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret
export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
You can also configure the credentials in the application.properties file such as:
camel.vault.azure.tenantId = accessKey camel.vault.azure.clientId = clientId camel.vault.azure.clientSecret = clientSecret camel.vault.azure.vaultName = vaultName
camel.vault.azure.tenantId = accessKey
camel.vault.azure.clientId = clientId
camel.vault.azure.clientSecret = clientSecret
camel.vault.azure.vaultName = vaultName
Or you can enable the usage of Azure Identity in the following way:
export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
You can also enable the usage of Azure Identity in the application.properties file such as:
camel.vault.azure.azureIdentityEnabled = true camel.vault.azure.vaultName = vaultName
camel.vault.azure.azureIdentityEnabled = true
camel.vault.azure.vaultName = vaultName
At this point you’ll be able to reference a property in the following way:
Where route will be the name of the secret stored in the Azure Key Vault Service.
You could specify a default value in case the secret is not present on Azure Key Vault Service:
In this case if the secret doesn’t exist, the property will fallback to "default" as value.
Also you are able to get particular field of the secret, if you have for example a secret named database of this form:
You’re able to do get single secret value in your route, like for example:
Or re-use the property as part of an endpoint.
You could specify a default value in case the particular field of secret is not present on Azure Key Vault:
In this case if the secret doesn’t exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value.
For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done.
The only requirement is adding the camel-azure-key-vault jar to your Camel application.
7.5.1.4. Using Hashicorp Vault Copy linkLink copied to clipboard!
To use this function, you’ll need to provide credentials for Hashicorp vault as environment variables:
export $CAMEL_VAULT_HASHICORP_TOKEN=token export $CAMEL_VAULT_HASHICORP_HOST=host export $CAMEL_VAULT_HASHICORP_PORT=port export $CAMEL_VAULT_HASHICORP_SCHEME=http/https
export $CAMEL_VAULT_HASHICORP_TOKEN=token
export $CAMEL_VAULT_HASHICORP_HOST=host
export $CAMEL_VAULT_HASHICORP_PORT=port
export $CAMEL_VAULT_HASHICORP_SCHEME=http/https
You can also configure the credentials in the application.properties file such as:
camel.vault.hashicorp.token = token camel.vault.hashicorp.host = host camel.vault.hashicorp.port = port camel.vault.hashicorp.scheme = scheme
camel.vault.hashicorp.token = token
camel.vault.hashicorp.host = host
camel.vault.hashicorp.port = port
camel.vault.hashicorp.scheme = scheme
At this point, you’ll be able to reference a property in the following way:
Where route will be the name of the secret stored in the Hashicorp Vault instance, in the 'secret' engine.
You could specify a default value in case the secret is not present on Hashicorp Vault instance:
In this case, if the secret doesn’t exist in the 'secret' engine, the property will fall back to "default" as value.
Also, you are able to get a particular field of the secret, if you have, for example, a secret named database of this form:
You’re able to do get single secret value in your route, in the 'secret' engine, like for example:
Or re-use the property as part of an endpoint.
You could specify a default value in case the particular field of secret is not present on Hashicorp Vault instance, in the 'secret' engine:
In this case, if the secret doesn’t exist or the secret exists (in the 'secret' engine) but the username field is not part of the secret, the property will fall back to "admin" as value.
There is also the syntax to get a particular version of the secret for both the approach, with field/default value specified or only with secret:
This approach will return the RAW route secret with version '2', in the 'secret' engine.
This approach will return the route secret value with version '2' or default value in case the secret doesn’t exist or the version doesn’t exist (in the 'secret' engine).
This approach will return the username field of the database secret with version '2' or admin in case the secret doesn’t exist or the version doesn’t exist (in the 'secret' engine).
7.5.1.5. Automatic Camel context reloading on Secret Refresh while using AWS Secrets Manager Copy linkLink copied to clipboard!
Being able to reload Camel context on a Secret Refresh, could be done by specifying the usual credentials (the same used for AWS Secret Manager Property Function).
With Environment variables:
export $CAMEL_VAULT_AWS_USE_DEFAULT_CREDENTIALS_PROVIDER=accessKey export $CAMEL_VAULT_AWS_REGION=region
export $CAMEL_VAULT_AWS_USE_DEFAULT_CREDENTIALS_PROVIDER=accessKey
export $CAMEL_VAULT_AWS_REGION=region
or as plain Camel main properties:
camel.vault.aws.useDefaultCredentialProvider = true camel.vault.aws.region = region
camel.vault.aws.useDefaultCredentialProvider = true
camel.vault.aws.region = region
Or by specifying accessKey/SecretKey and region, instead of using the default credentials provider chain.
To enable the automatic refresh you’ll need additional properties to set:
camel.vault.aws.refreshEnabled=true camel.vault.aws.refreshPeriod=60000 camel.vault.aws.secrets=Secret camel.main.context-reload-enabled = true
camel.vault.aws.refreshEnabled=true
camel.vault.aws.refreshPeriod=60000
camel.vault.aws.secrets=Secret
camel.main.context-reload-enabled = true
where camel.vault.aws.refreshEnabled will enable the automatic context reload, camel.vault.aws.refreshPeriod is the interval of time between two different checks for update events and camel.vault.aws.secrets is a regex representing the secrets we want to track for updates.
Note that camel.vault.aws.secrets is not mandatory: if not specified the task responsible for checking updates events will take into accounts or the properties with an aws: prefix.
The only requirement is adding the camel-aws-secrets-manager jar to your Camel application.
7.5.1.6. Automatic Camel context reloading on Secret Refresh while using AWS Secrets Manager with Eventbridge and AWS SQS Services Copy linkLink copied to clipboard!
Another option is to use AWS EventBridge in conjunction with the AWS SQS service.
On the AWS side, the following resources need to be created:
- an AWS Couldtrail trail
- an AWS SQS Queue
- an Eventbridge rule of the following kind
This rule will make the event related to AWS Secrets Manager filtered
- You need to set the a Rule target to the AWS SQS Queue for Eventbridge rule
- You need to give permission to the Eventbrige rule, to write on the above SQS Queue. For doing this you’ll need to define a json file like this:
{
"Policy": "{\"Version\":\"2012-10-17\",\"Id\":\"<queue_arn>/SQSDefaultPolicy\",\"Statement\":[{\"Sid\": \"EventsToMyQueue\", \"Effect\": \"Allow\", \"Principal\": {\"Service\": \"events.amazonaws.com\"}, \"Action\": \"sqs:SendMessage\", \"Resource\": \"<queue_arn>\", \"Condition\": {\"ArnEquals\": {\"aws:SourceArn\": \"<eventbridge_rule_arn>\"}}}]}"
}
{
"Policy": "{\"Version\":\"2012-10-17\",\"Id\":\"<queue_arn>/SQSDefaultPolicy\",\"Statement\":[{\"Sid\": \"EventsToMyQueue\", \"Effect\": \"Allow\", \"Principal\": {\"Service\": \"events.amazonaws.com\"}, \"Action\": \"sqs:SendMessage\", \"Resource\": \"<queue_arn>\", \"Condition\": {\"ArnEquals\": {\"aws:SourceArn\": \"<eventbridge_rule_arn>\"}}}]}"
}
Change the values for queue_arn and eventbridge_rule_arn, save the file with policy.json name and run the following command with AWS CLI
aws sqs set-queue-attributes --queue-url <queue_url> --attributes file://policy.json
aws sqs set-queue-attributes --queue-url <queue_url> --attributes file://policy.json
where queue_url is the AWS SQS Queue URL of the just created Queue.
Now you should be able to set up the configuration on the Camel side. To enable the SQS notification add the following properties:
where queue_url is the AWS SQS Queue URL of the just created Queue.
Whenever an event of PutSecretValue for the Secret named 'Secret' will happen, a message will be enqueued in the AWS SQS Queue and consumed on the Camel side and a context reload will be triggered.
7.5.1.7. Automatic Camel context reloading on Secret Refresh while using Google Secret Manager Copy linkLink copied to clipboard!
Being able to reload Camel context on a Secret Refresh, could be done by specifying the usual credentials (the same used for Google Secret Manager Property Function).
With Environment variables:
export $CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE=true export $CAMEL_VAULT_GCP_PROJECT_ID=projectId
export $CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE=true
export $CAMEL_VAULT_GCP_PROJECT_ID=projectId
or as plain Camel main properties:
camel.vault.gcp.useDefaultInstance = true camel.vault.aws.projectId = projectId
camel.vault.gcp.useDefaultInstance = true
camel.vault.aws.projectId = projectId
Or by specifying a path to a service account key file, instead of using the default instance.
To enable the automatic refresh you’ll need additional properties to set:
where camel.vault.gcp.refreshEnabled will enable the automatic context reload, camel.vault.gcp.refreshPeriod is the interval of time between two different checks for update events and camel.vault.gcp.secrets is a regex representing the secrets we want to track for updates.
Note that camel.vault.gcp.secrets is not mandatory: if not specified the task responsible for checking updates events will take into accounts or the properties with an gcp: prefix.
The camel.vault.gcp.subscriptionName is the subscription name created in relation to the Google PubSub topic associated with the tracked secrets.
This mechanism while make use of the notification system related to Google Secret Manager: through this feature, every secret could be associated to one up to ten Google Pubsub Topics. These topics will receive events related to life cycle of the secret.
There are only two requirements: - Adding camel-google-secret-manager JAR to your Camel application. - Give the service account used permissions to do operation at secret management level (for example accessing the secret payload, or being admin of secret manager service and also have permission over the Pubsub service)
7.5.1.8. Automatic Camel context reloading on Secret Refresh while using Azure Key Vault Copy linkLink copied to clipboard!
Being able to reload Camel context on a Secret Refresh, could be done by specifying the usual credentials (the same used for Azure Key Vault Property Function).
With Environment variables:
export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId
export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId
export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret
export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
or as plain Camel main properties:
camel.vault.azure.tenantId = accessKey camel.vault.azure.clientId = clientId camel.vault.azure.clientSecret = clientSecret camel.vault.azure.vaultName = vaultName
camel.vault.azure.tenantId = accessKey
camel.vault.azure.clientId = clientId
camel.vault.azure.clientSecret = clientSecret
camel.vault.azure.vaultName = vaultName
If you want to use Azure Identity with environment variables, you can do in the following way:
export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
You can also enable the usage of Azure Identity in the application.properties file such as:
camel.vault.azure.azureIdentityEnabled = true camel.vault.azure.vaultName = vaultName
camel.vault.azure.azureIdentityEnabled = true
camel.vault.azure.vaultName = vaultName
To enable the automatic refresh you’ll need additional properties to set:
where camel.vault.azure.refreshEnabled will enable the automatic context reload, camel.vault.azure.refreshPeriod is the interval of time between two different checks for update events and camel.vault.azure.secrets is a regex representing the secrets we want to track for updates.
where camel.vault.azure.eventhubConnectionString is the eventhub connection string to get notification from, camel.vault.azure.blobAccountName, camel.vault.azure.blobContainerName and camel.vault.azure.blobAccessKey are the Azure Storage Blob parameters for the checkpoint store needed by Azure Eventhub.
Note that camel.vault.azure.secrets is not mandatory: if not specified the task responsible for checking updates events will take into accounts or the properties with an azure: prefix.
The only requirement is adding the camel-azure-key-vault jar to your Camel application.
Chapter 8. Camel Quarkus transaction guide Copy linkLink copied to clipboard!
8.1. About the transaction guide Copy linkLink copied to clipboard!
This guide provides information and instructions for implementing transactional applications with Red Hat build of Apache Camel for Quarkus.
8.2. JTA dependencies Copy linkLink copied to clipboard!
In order to use camel-quarkus-jta, you need to include the following dependency in your pom.xml
<dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-jta</artifactId> </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jta</artifactId>
</dependency>
This leverages quarkus-narayana-jta to provide JTA support in Camel.
8.2.1. Important configurations Copy linkLink copied to clipboard!
There are some important quarkus.transaction-manager configurations you need to be aware of:
| Configuration | Default value | Description | Comment |
|---|---|---|---|
|
|
| Identifes the node. It needs to be unique and stable over both transaction manager and container restarts. | For more information, see Configuring transaction node name identifier in the Quarkus documentation. |
|
|
|
Configures where the transaction logs are stored - either in a directory ( | For a cloud environment without access to persistent volumes, consider using the jdbc object store. For more information, see Configure storing of Quarkus transaction logs in a database section in the Quarkus documentation |
|
|
| Enables recovery of pending transactions in case of a JVM crash or shutdown. |
We recommend that you set it to |
8.3. Configuring transactional resources Copy linkLink copied to clipboard!
8.3.1. JDBC Datasource configuration Copy linkLink copied to clipboard!
To configure the datasource:
- Include the relevant jdbc extension by following the Configure datasources in Quarkus section in the Quarkus datasource guide.
The extensions are integrated with the Quarkus agroal extension to support pooling and XA transactions.
Optional
If you want to use the datasource in a XA transaction, you must enable it:
quarkus.datasource.jdbc.transactions = xaquarkus.datasource.<datasource-name>.jdbc.transactions = xaFor more information, refer to the Narayana transaction manager integration section in the Quarkus datasource guide.
Do not mix using non-XA and XA datasource in a transaction.
It is not a transaction safe.
8.3.2. JMS Configuration Copy linkLink copied to clipboard!
In order to use JMS with distributed transactions, you must do the following:
Use
quarkus-pooled-jmsto support pooling and transaction, by including the following dependency in yourpom.xml:<dependency> <groupId>io.quarkiverse.messaginghub</groupId> <artifactId>quarkus-pooled-jms</artifactId> </dependency><dependency> <groupId>io.quarkiverse.messaginghub</groupId> <artifactId>quarkus-pooled-jms</artifactId> </dependency>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable XA support by setting
.transactiontoxa:quarkus.pooled-jms.transaction = xa
For more details, see Support for connection pooling and X/Open XA distributed transactions in the JMS extension documentation.
8.4. Examples Copy linkLink copied to clipboard!
- JPA and JMS
We use Narayana as the standalone JTA Transaction Manager implementation, and Hibernate as the JPA Adapter.
- Message Bridge
A basic REST endpoint is provided for users to dispatch a message to the IBM MQ queue. Messages from the IBM MQ are relayed to an ActiveMQ queue within an XA transaction. This example showcases the transaction functionality with rollback and recovery.
8.5. Transaction policies Copy linkLink copied to clipboard!
There are six transaction policies:
| Policy | Description | Comment |
|---|---|---|
|
| 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. | Default |
|
| Create a new transaction, suspending the current transaction if one exists. | |
|
| Support a current transaction; execute non-transactionally if none exists. |
For more details, see Using different transaction propagations in the Quarkus Transactional client documentation.
8.6. Known issues Copy linkLink copied to clipboard!
8.6.1. Non-XA datasource compatibility Copy linkLink copied to clipboard!
Since 3.8.4, there is a compatibility break issue when using non-XA datasource. For more information see the pull request 40365