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. 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. |
Chapter 2. Camel Quarkus extensions overview Copy linkLink copied to clipboard!
2.1. Supported Extensions Copy linkLink copied to clipboard!
There are 97 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 | AWS2 CloudWatch | Sending metrics to AWS CloudWatch using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 4 | 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 | |
| 5 | AWS2 Kinesis | Consume and produce records from AWS Kinesis Streams using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 6 | AWS2 Lambda | Manage and invoke AWS Lambda functions using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 7 | AWS2 S3 Storage | Store and retrieve objects from AWS S3 Storage Service using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 8 | AWS2 Simple Notification System (SNS) | Send messages to an AWS Simple Notification Topic using AWS SDK version 2.x. | Production Support | Production Support | Yes | |
| 9 | 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 | |
| 10 | Azure ServiceBus | Send and receive messages to/from Azure Service Bus. | Technology Preview | Technology Preview | Yes | |
| 11 | Azure Storage Blob | Store and retrieve blobs from Azure Storage Blob Service using SDK v12. | Technology Preview | Technology Preview | Yes | |
| 12 | Azure Storage Queue |
The | Technology Preview | Technology Preview | Yes | |
| 13 | Bean | Invoke methods of Java beans | Production Support | Production Support | Yes | |
| 14 | Bean-validator | Validate the message body using the Java Bean Validation API. | Production Support | Production Support | Yes | |
| 15 | Browse | Inspect the messages received on endpoints supporting BrowsableEndpoint. | Production Support | Production Support | Yes | |
| 16 | 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 | |
| 17 | Cli-connector | Runtime adapter connecting with Camel CLI | Production Support | Production Support | Yes | |
| 18 | Controlbus | Manage and monitor Camel routes. | Production Support | Production Support | Yes | |
| 19 | Core | Camel core functionality and basic Camel languages/ Constant, ExchangeProperty, Header, Ref, Simple and Tokenize | Production Support | Production Support | Yes | |
| 20 | Crypto | Sign and verify exchanges using the Signature Service of the Java Cryptographic Extension (JCE). | Production Support | Production Support | Yes | |
| 21 | Cron | A generic interface for triggering events at times specified through the Unix cron syntax. | Production Support | Production Support | Yes | |
| 22 | CXF SOAP | Expose SOAP WebServices using Apache CXF or connect to external WebServices using CXF WS client. | Production Support | Production Support | Yes | |
| 23 | Dataformat | Use a Camel Data Format as a regular Camel Component. | Production Support | Production Support | Yes | |
| 24 | Dataset | Provide data for load and soak testing of your Camel application. | Technology Previee | Technology Previee | Yes | |
| 25 | Direct | Call another endpoint from the same Camel Context synchronously. | Production Support | Production Support | Yes | |
| 26 | 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 | |
| 27 | File | Read and write files. | Production Support | Production Support | Yes | |
| 28 | FTP | Upload and download files to/from SFTP, FTP or SFTP servers | Production Support | Production Support | Yes | |
| 29 | Google BigQuery | Access Google Cloud BigQuery service using SQL queries or Google Client Services API | Production Support | Production Support | Yes | |
| 30 | Google Pubsub | Send and receive messages to/from Google Cloud Platform PubSub Service. | Production Support | Production Support | Yes | |
| 31 | gRPC | Expose gRPC endpoints and access external gRPC endpoints. | Production Support | Production Support | Yes | |
| 32 | HTTP | Send requests to external HTTP servers using Apache HTTP Client 5.x. | Production Support | Production Support | Yes | |
| 33 | Infinispan | Read and write from/to Infinispan distributed key/value store and data grid. | Production Support | Production Support | No | |
| 34 | Jasypt | Security using Jasypt | Production Support | Production Support | Yes | |
| 35 | Java JOOR DSL | Support for parsing Java route definitions at runtime | Community Support | Community Support | Yes | |
| 36 | JDBC | Access databases through SQL and JDBC. | Production Support | Production Support | Yes | |
| 37 | JIRA | Interact with JIRA issue tracker. | Production Support | Production Support | Yes | |
| 38 | JMS | Sent and receive messages to/from a JMS Queue or Topic. | Production Support | Production Support | Yes | |
| 39 | JPA | Store and retrieve Java objects from databases using Java Persistence API (JPA). | Production Support | Production Support | Yes | |
| 40 | 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 | |
| 41 | JTA | Enclose Camel routes in transactions using Java Transaction API (JTA) and Narayana transaction manager | Production Support | Production Support | Yes | |
| 42 | Kafka | Sent and receive messages to/from an Apache Kafka broker. | Production Support | Production Support | Yes | |
| 43 | Kamelet | Materialize route templates | Production Support | Production Support | Yes | |
| 44 | Kubernetes | Perform operations against Kubernetes API | Technology Preview | Technology Preview | Yes | |
| 45 | Kudu | Interact with Apache Kudu, a free and open source column-oriented data store of the Apache Hadoop ecosystem. | Production Support | Production Support | No | |
| 46 | Language | Execute scripts in any of the languages supported by Camel. | Production Support | Production Support | Yes | |
| 47 | LDAP | Perform searches on LDAP servers. | Production Support | Production Support | Yes | |
| 48 | Log | Log messages to the underlying logging mechanism. | Production Support | Production Support | Yes | |
| 49 | LRA | Camel saga binding for Long-Running-Action framework. | Technology Preview | Technology Preview | Yes | |
| 50 | | 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 | |
| 51 | Management | JMX management strategy and associated managed resources. | Production Support | Production Support | Yes | |
| 52 | MapStruct | Type Conversion using Mapstruct | Production Support | Production Support | Yes | |
| 53 | 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 | |
| 54 | Micrometer | Collect various metrics directly from Camel routes using the Micrometer library. | Production Support | Production Support | Yes | |
| 55 | MicroProfile Fault Tolerance | Circuit Breaker EIP using Microprofile Fault Tolerance | Production Support | Production Support | Yes | |
| 56 | MicroProfile Health | Expose Camel health checks via MicroProfile Health | Production Support | Production Support | Yes | |
| 57 | Minio | Store and retrieve objects from Minio Storage Service using Minio SDK. | Production Support | Production Support | Yes | |
| 58 | MLLP | Communicate with external systems using the MLLP protocol. | Production Support | Production Support | Yes | |
| 59 | MyBatis | Performs a query, poll, insert, update or delete in a relational database using MyBatis. | Production Support | Production Support | Yes | |
| 60 | Mock | Test routes and mediation rules using mocks. | Production Support | Production Support | Yes | |
| 61 | MongoDB | Perform operations on MongoDB documents and collections. | Technology Preview | Technology Preview | Yes | |
| 62 | Netty | Socket level networking using TCP or UDP with Netty 4.x. | Production Support | Production Support | Yes | |
| 63 | Netty HTTP | Netty HTTP server and client using the Netty 4.x. | Production Support | Production Support | Yes | |
| 64 | Openapi Java | Expose OpenAPI resources defined in Camel REST DSL | Production Support | Production Support | Yes | |
| 65 | OpenTelemetry | Distributed tracing using OpenTelemetry | Production Support | Production Support | Yes | |
| 66 | Quartz | Schedule sending of messages using the Quartz 2.x scheduler. | Production Support | Production Support | Yes | |
| 67 | Paho | Communicate with MQTT message brokers using Eclipse Paho MQTT Client. | Production Support | Production Support | Yes | |
| 68 | Paho MQTT5 | Communicate with MQTT message brokers using Eclipse Paho MQTT v5 Client. | Production Support | Production Support | Yes | |
| 69 | Platform HTTP | Expose HTTP endpoints using the HTTP server available in the current platform. | Production Support | Production Support | Yes | |
| 70 | Ref | Route messages to an endpoint looked up dynamically by name in the Camel Registry. | Production Support | Production Support | Yes | |
| 71 | REST | Expose REST services and their OpenAPI Specification or call external REST services. | Production Support | Production Support | Yes | |
| 72 | REST OpenAPI | Configure REST producers based on an OpenAPI specification document delegating to a component implementing the RestProducerFactory interface. | Production Support | Production Support | Yes | |
| 73 | Salesforce | Communicate with Salesforce using Java DTOs. | Production Support | Production Support | Yes | |
| 74 | SAGA | Execute custom actions within a route using the Saga EIP. | Technology Preview | Technology Preview | Yes | |
| 75 | SAP | Provides SAP Camel Component. | Production Support | None | Yes | |
| 76 | Saxon | Query and/or transform XML payloads using XQuery and Saxon. | Production Support | Production Support | Yes | |
| 77 | Scheduler | Generate messages in specified intervals using java.util.concurrent.ScheduledExecutorService. | Production Support | Production Support | Yes | |
| 78 | Seda | Asynchronously call another endpoint from any Camel Context in the same JVM. | Production Support | Production Support | Yes | |
| 79 | Servlet | Serve HTTP requests by a Servlet. | Production Support | Production Support | Yes | |
| 80 | Slack | Send and receive messages to/from Slack. | Production Support | Production Support | Yes | |
| 81 | SNMP | Receive traps and poll SNMP (Simple Network Management Protocol) capable devices. | Production Support | Technology Preview | Yes | |
| 82 | Splunk | Publish or search for events in Splunk. | Production Support | Production Support | Yes | |
| 83 | Splunk HEC | The splunk component allows to publish events in Splunk using the HTTP Event Collector. | Production Support | Production Support | Yes | |
| 84 | SQL | Perform SQL queries. | Production Support | Production Support | Yes | |
| 85 | Telegram | Send and receive messages acting as a Telegram Bot Telegram Bot API. | Production Support | Production Support | Yes | |
| 86 | Timer | Generate messages in specified intervals using java.util.Timer. | Production Support | Production Support | Yes | |
| 87 | Validator | Validate the payload using XML Schema and JAXP Validation. | Production Support | Production Support | Yes | |
| 88 | Velocity | Transform messages using a Velocity template. | Production Support | Production Support | Yes | |
| 89 | VertX HTTP | Camel HTTP client support with Vert.x | Production Support | Production Support | Yes | |
| 90 | VertX Websocket | Camel WebSocket support with Vert.x | Production Support | Production Support | Yes | |
| 91 | XJ | Transform JSON and XML message using a XSLT | Production Support | Production Support | Yes | |
| 92 | XML IO DSL | An XML stack for parsing XML route definitions | Production Support | Production Support | Yes | |
| 93 | XSLT | Transforms XML payload using an XSLT template. | Production Support | Production Support | Yes | |
| 94 | XSLT Saxon | Transform XML payloads using an XSLT template using Saxon. | Production Support | Production Support | Yes | |
| 95 | Zip File | Compression and decompress streams using java.util.zip.ZipStream. | Production Support | Production Support | Yes | |
| 96 | 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 |
2.2. Supported Languages Copy linkLink copied to clipboard!
There are 7 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 | |
| 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 | Xpath | Evaluates an XPath expression against an XML payload | Production Support | Production Support | Yes | |
| 9 | YAML DSL | Production Support | Production Support | Yes | A YAML stack for parsing YAML route definitions |
2.3. Supported Data formats Copy linkLink copied to clipboard!
There are 13 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 | 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 | |
| 3 | Crypto | Java Cryptographic Extension: Symmetric (shared-key) encryption and decryption using Camel’s marshal and unmarshal formatting mechanism. | Production Support | Production Support | Yes | |
| 4 | Gson | Marshal POJOs to JSON and back using Gson | Production Support | Production Support | Yes | |
| 5 | Hl7 | Marshal and unmarshal HL7 (Health Care) model objects using the HL7 MLLP codec. | Production Support | Production Support | Yes | |
| 6 | Jackson | Marshal POJOs to JSON and back using Jackson | Production Support | Production Support | Yes | |
| 7 | Jackson Avro | Marshal POJOs to Avro and back using Jackson. | Production Support | Production Support | Yes | |
| 8 | Jackson ProtoBuf | Marshal POJOs to Protobuf and back using Jackson. | Production Support | Production Support | Yes | |
| 9 | Jackson XML | Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson. | Production Support | Production Support | Yes | |
| 10 | Jaxb | Unmarshal XML payloads to POJOs and back using JAXB2 XML marshalling standard. | Production Support | Production Support | Yes | |
| 11 | Xml-JAXP | Camel XML JAXP | Production Support | Production Support | Yes | |
| 12 | PGP | Symmetric (shared-key) encryption and decryption using Camel’s marshal and unmarshal formatting mechanism. | Production Support | Production Support | Yes | |
| 13 | SOAP | Marshal Java objects to SOAP messages and back. | Production Support | Production Support | Yes |
Chapter 3. Camel Quarkus extensions reference Copy linkLink copied to clipboard!
This chapter provides usage information for Red Hat build of Apache Camel for Quarkus.
3.1. AMQP Copy linkLink copied to clipboard!
Messaging with AMQP protocol using Apache QPid Client.
3.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.
3.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>
3.1.3. Usage Copy linkLink copied to clipboard!
3.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.
3.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.
3.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
3.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)
3.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.
3.2. Attachments Copy linkLink copied to clipboard!
Support for attachments on Camel messages
3.2.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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>
3.3. Avro Copy linkLink copied to clipboard!
Serialize and deserialize messages using Apache Avro binary data format.
3.3.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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>
3.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
Please see a working configuration in Camel Quarkus Avro integration test and Quarkus Avro integration test.
3.4. AWS 2 CloudWatch Copy linkLink copied to clipboard!
Sending metrics to AWS CloudWatch.
3.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.
3.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>
3.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.
3.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.
3.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.
3.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>
3.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.
3.5.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.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. Please 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
3.6. AWS 2 Kinesis Copy linkLink copied to clipboard!
Consume and produce records from AWS Kinesis Streams using AWS SDK version 2.x.
3.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.
3.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>
3.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.
3.7. AWS 2 Lambda Copy linkLink copied to clipboard!
Manage and invoke AWS Lambda functions using AWS SDK version 2.x.
3.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.
3.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>
3.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.
3.7.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.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.
3.8. AWS 2 S3 Storage Service Copy linkLink copied to clipboard!
Store and retrieve objects from AWS S3 Storage Service.
3.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.
3.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>
3.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.
3.8.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.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. Please 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
3.9. AWS 2 Simple Notification System (SNS) Copy linkLink copied to clipboard!
Send messages to an AWS Simple Notification Topic.
3.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.
3.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>
3.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.
3.9.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.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. Please 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
3.10. AWS 2 Simple Queue Service (SQS) Copy linkLink copied to clipboard!
Send and receive messages to/from AWS SQS service.
3.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.
3.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>
3.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.
3.10.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.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. Please 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
3.11. Azure ServiceBus Copy linkLink copied to clipboard!
Send and receive messages to/from Azure Service Bus.
3.11.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.
3.11.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>
3.12. Azure Storage Blob Service Copy linkLink copied to clipboard!
Store and retrieve blobs from Azure Storage Blob Service using SDK v12.
3.12.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.
3.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-storage-blob</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-azure-storage-blob</artifactId>
</dependency>
3.12.3. Usage Copy linkLink copied to clipboard!
3.12.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>
3.12.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.
3.13. 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.
3.13.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.
3.13.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>
3.13.3. Usage Copy linkLink copied to clipboard!
3.13.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>
3.13.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.
3.14. Bean Validator Copy linkLink copied to clipboard!
Validate the message body using the Java Bean Validation API.
3.14.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.
3.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-bean-validator</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bean-validator</artifactId>
</dependency>
3.14.3. Usage Copy linkLink copied to clipboard!
3.14.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.
3.14.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 {
}
3.14.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).
3.15. Bean Copy linkLink copied to clipboard!
Invoke methods of Java beans
3.15.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.
3.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-bean</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bean</artifactId>
</dependency>
3.15.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.
3.16. 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
3.16.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above links for usage and configuration details.
3.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-bindy</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bindy</artifactId>
</dependency>
3.16.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.
3.17. Browse Copy linkLink copied to clipboard!
Inspect the messages received on endpoints supporting BrowsableEndpoint.
3.17.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.
3.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-browse</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-browse</artifactId>
</dependency>
3.18. 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.
3.18.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.
3.18.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>
3.18.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.18.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).
3.19. CLI Connector Copy linkLink copied to clipboard!
Runtime adapter connecting with Camel CLI
3.19.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.19.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>
3.20. Control Bus Copy linkLink copied to clipboard!
Manage and monitor Camel routes.
3.20.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.
3.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-controlbus</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-controlbus</artifactId>
</dependency>
3.20.3. Usage Copy linkLink copied to clipboard!
3.20.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>
3.20.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:
3.20.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.
3.20.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
3.20.4. Camel Quarkus limitations Copy linkLink copied to clipboard!
3.20.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.
3.21. Core Copy linkLink copied to clipboard!
Camel core functionality and basic Camel languages/ Constant, ExchangeProperty, Header, Ref, Simple and Tokenize
3.21.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above links for usage and configuration details.
3.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-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>
3.21.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.21.3.1. Simple language Copy linkLink copied to clipboard!
3.21.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.
3.21.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.
3.21.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
3.21.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: |
| |
|
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: |
| |
|
A comma-separated list of Ant-path style patterns to match Camel service definition files in the classpath. The services defined in the matching files will not be added to Camel registry during application’s static initialization. The excludes have higher precedence than includes. The excludes defined here can also be used to veto the registration of services included by Camel Quarkus extensions.
Example values: |
| |
|
A comma-separated list of Ant-path style patterns to match Camel service definition files in the classpath. The services defined in the matching files will be added to Camel registry during application’s static initialization unless the given file is excluded via
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: |
| |
|
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/* |
| |
|
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/* |
| |
|
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. |
| |
|
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 |
| |
|
If |
|
|
|
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 |
|
|
|
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.
3.22. Cron Copy linkLink copied to clipboard!
A generic interface for triggering events at times specified through the Unix cron syntax.
3.22.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.
3.22.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>
3.22.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.
3.23. Crypto (JCE) Copy linkLink copied to clipboard!
Sign and verify exchanges using the Signature Service of the Java Cryptographic Extension (JCE).
3.23.1. What’s inside Copy linkLink copied to clipboard!
- Crypto (Java Cryptographic Extension) data format
-
Crypto (JCE) component, URI syntax:
crypto:cryptoOperation:name - PGP data format
Refer to the above links for usage and configuration details.
3.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-crypto</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-crypto</artifactId>
</dependency>
3.23.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.
3.24. CXF Copy linkLink copied to clipboard!
Expose SOAP WebServices using Apache CXF or connect to external WebServices using CXF WS client.
3.24.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.
3.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-cxf-soap</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-cxf-soap</artifactId>
</dependency>
3.24.3. Usage Copy linkLink copied to clipboard!
3.24.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.
== Supported extensions
Currently, only these quarkus-cxf extensions are supported:
Implicitly, as transitive dependencies of camel-quarkus-cxf-soap:
-
quarkus-cxf -
quarkus-cxf-rt-features-logging
If you need WS-Security or other associated functionality, you can add the following supported extensions:
-
quarkus-cxf-rt-ws-security -
quarkus-cxf-services-sts -
quarkus-cxf-xjc-plugins
=== WS-ReliableMessaging
Full support for CXF WS-ReliableMessaging is currently unavailable, and it remains in Technology Preview in version 3.8.
To learn about supported use cases and WS specifications, see the Quarkus CXF Reference.
3.24.3.2. Dependency management Copy linkLink copied to clipboard!
Red Hat build of Apache Camel for Quarkus manages the CXF and quarkus-cxf versions. You do not need to select compatible versions for those projects.
3.24.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.
3.24.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 Red Hat build of Apache Camel for Quarkus 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.
3.24.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.
3.24.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 Red Hat build of Apache Camel for Quarkus and Quarkus CXF contain a number of integration tests which can serve as executable examples of applications that implement various WS specifications.
3.24.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
3.24.3.8. Possible DoS vector with CXF clients using java.net.http.HttpClient Copy linkLink copied to clipboard!
If your CXF clients are using java.net.http.HttpClient as the underlying HTTP client, then due to CXF issue, the application may crash if many clients are created, as their threads do not terminated.
The problem occurs with java.net.http.HttpClient when CXF clients is created repeatedly, for example per request. If you keep the clients throughout the whole lifespan of the application, this issue does not occur.
Since Apache Camel for Quarkus 3.2.0 and Quarkus CXF 2.2.3, the selection of the HTTP client implementation for some specific CXF client is controlled via quarkus.cxf.client.yourClient.http-conduit-factory property. By default, the CXF clients created by Quarkus CXF use java.net.HttpURLConnection as an HTTP client and thus, this issue does not occur by default. This issue may occur if you set quarkus.cxf.client.yourClient.http-conduit-factory=HttpClientHTTPConduitFactory.
3.24.3.8.1. Mitigation of the DoS vector Copy linkLink copied to clipboard!
-
Only use
java.net.http.HttpClient-backed CXF clients if you are absolutely certain that the clients are only created once during the lifespan of the application. -
Use CXF clients backed by different HTTP client implementations such as HC5 or
java.net.HttpURLConnection.
3.25. 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 Red Hat build of Apache Camel for Quarkus, see Supported Data Formats.
3.25.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.
3.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-dataformat</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-dataformat</artifactId>
</dependency>
3.26. Dataset Copy linkLink copied to clipboard!
Provide data for load and soak testing of your Camel application.
3.26.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.
3.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-dataset</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-dataset</artifactId>
</dependency>
3.27. Direct Copy linkLink copied to clipboard!
Call another endpoint from the same Camel Context synchronously.
3.27.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.
3.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-direct</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-direct</artifactId>
</dependency>
3.28. Elasticsearch Copy linkLink copied to clipboard!
Send requests to ElasticSearch via Java Client API.
3.28.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.
3.28.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>
3.29. Elasticsearch Low level Rest Client Copy linkLink copied to clipboard!
Perform queries and other operations on Elasticsearch or OpenSearch (uses low-level client).
3.29.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.
3.29.2. Maven coordinates Copy linkLink copied to clipboard!
<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>
3.30. 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.
3.30.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.
3.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-fhir</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-fhir</artifactId>
</dependency>
3.30.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.
3.30.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.
3.31. File Copy linkLink copied to clipboard!
Read and write files.
3.31.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.
3.31.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>
3.31.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.31.3.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 enable the file cluster service with a property like below:
quarkus.camel.cluster.file.enabled = true quarkus.camel.cluster.file-root = target/cluster-folder-where-lock-file-will-be-held
quarkus.camel.cluster.file.enabled = true
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). |
| |
|
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). |
| |
|
The custom attributes associated to the service (defaults to empty map). |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
3.32. FTP Copy linkLink copied to clipboard!
Upload and download files to/from SFTP, FTP or SFTP servers
3.32.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.
3.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-ftp</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-ftp</artifactId>
</dependency>
3.33. Google BigQuery Copy linkLink copied to clipboard!
Access Google Cloud BigQuery service using SQL queries or Google Client Services API
3.33.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.
3.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-google-bigquery</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-bigquery</artifactId>
</dependency>
3.33.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. Please check Quarkus documentation for more details.
3.34. Google Pubsub Copy linkLink copied to clipboard!
Send and receive messages to/from Google Cloud Platform PubSub Service.
3.34.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.
3.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-google-pubsub</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-google-pubsub</artifactId>
</dependency>
3.34.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.
3.35. gRPC Copy linkLink copied to clipboard!
Expose gRPC endpoints and access external gRPC endpoints.
3.35.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.
3.35.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>
3.35.3. Usage Copy linkLink copied to clipboard!
3.35.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.
3.35.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.
3.35.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 \.
3.35.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
3.35.4. Camel Quarkus limitations Copy linkLink copied to clipboard!
3.35.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.
3.35.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. |
|
|
|
Package path or file glob pattern includes per dependency containing .proto files to be considered for inclusion. |
| |
|
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.
3.36. Gson Copy linkLink copied to clipboard!
Marshal POJOs to JSON and back using Gson
3.36.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.36.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>
3.36.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.36.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.
3.37. HL7 Copy linkLink copied to clipboard!
Marshal and unmarshal HL7 (Health Care) model objects using the HL7 MLLP codec.
3.37.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above links for usage and configuration details.
3.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-hl7</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-hl7</artifactId>
</dependency>
3.37.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.
3.38. HTTP Copy linkLink copied to clipboard!
Send requests to external HTTP servers using Apache HTTP Client 5.x.
3.38.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.
3.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-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-http</artifactId>
</dependency>
3.38.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.
3.38.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.
3.39. Infinispan Copy linkLink copied to clipboard!
Read and write from/to Infinispan distributed key/value store and data grid.
3.39.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.
3.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-infinispan</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-infinispan</artifactId>
</dependency>
3.39.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.39.3.1. Infinispan Client Configuration Copy linkLink copied to clipboard!
You can either configure the Infinispan client via the relevant Camel Infinispan component & endpoint options, or you may use the Quarkus Infinispan extension configuration properties.
Note that if you choose to use Quarkus Infinispan configuration properties, you must add an injection point for the RemoteCacheManager in order for it to be discoverable by the Camel Infinispan component. For example:
3.39.3.2. 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.
3.40. Avro Jackson Copy linkLink copied to clipboard!
Marshal POJOs to Avro and back using Jackson.
3.40.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.40.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>
3.41. Protobuf Jackson Copy linkLink copied to clipboard!
Marshal POJOs to Protobuf and back using Jackson.
3.41.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-jackson-protobuf</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jackson-protobuf</artifactId>
</dependency>
3.42. Jackson Copy linkLink copied to clipboard!
Marshal POJOs to JSON and back using Jackson
3.42.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jackson</artifactId>
</dependency>
3.42.3. Usage Copy linkLink copied to clipboard!
3.42.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.
3.42.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.
3.42.3.1.2. Custom ObjectMapper for JacksonDataFormat Copy linkLink copied to clipboard!
You can pass a custom ObjectMapper instance to JacksonDataFormat as follows.
3.42.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.
3.43. JacksonXML Copy linkLink copied to clipboard!
Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson.
3.43.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-jacksonxml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jacksonxml</artifactId>
</dependency>
3.44. Jasypt Copy linkLink copied to clipboard!
Security using Jasypt
3.44.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-jasypt</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jasypt</artifactId>
</dependency>
3.44.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.
3.44.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.
3.44.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.
3.44.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.
3.44.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
3.44.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.
3.44.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.
3.44.5. Camel Quarkus limitations Copy linkLink copied to clipboard!
3.44.6. Jasypt: quarkus.camel.jasypt.enabled=false not working Copy linkLink copied to clipboard!
The camel-quarkus-jasypt extension has an issue resolving configuration properties when they are provided from system properties or environment variables. For example, passing -Dquarkus.camel.jasypt.enabled=false or -Dquarkus.camel.jasypt.password=my-password does not work.
To work around this you can specify quarkus.camel.jasypt.enabled in application.properties.
Disable jasypt
quarkus.camel.jasypt.enabled = false
quarkus.camel.jasypt.enabled = false
To override quarkus.camel.jasypt.password from a system property or environment variable you can configure application.properties as follows:
Either hard code the password in application.properties
Hardcoded password
quarkus.camel.jasypt.password = my-password
quarkus.camel.jasypt.password = my-password
Or it’s possible to have the password resolved from a system property or environment variable using the 'sys' or 'sysenv' prefix.
Password with sys prefix
quarkus.camel.jasypt.password = sys:jasyptPassword
quarkus.camel.jasypt.password = sys:jasyptPassword
Then build the application with your desired password.
Building with password
mvn clean package -DjasyptPassword=my-password
mvn clean package -DjasyptPassword=my-password
And when running the application JAR.
Application JAR
java -DjasyptPassword=my-password -jar target/quarkus-app/quarkus-run.jar
java -DjasyptPassword=my-password -jar target/quarkus-app/quarkus-run.jar
Or in native mode:
Native mode
target/my-native-application-runner -DjasyptPassword=my-password
target/my-native-application-runner -DjasyptPassword=my-password
3.45. Java jOOR DSL Copy linkLink copied to clipboard!
Support for parsing Java route definitions at runtime
3.45.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-java-joor-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-java-joor-dsl</artifactId>
</dependency>
3.45.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 please note that the element registerFullHierarchy is not supported.
3.46. JAXB Copy linkLink copied to clipboard!
Unmarshal XML payloads to POJOs and back using JAXB2 XML marshalling standard.
3.46.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-jaxb</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jaxb</artifactId>
</dependency>
3.46.3. Usage Copy linkLink copied to clipboard!
3.46.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.
3.47. JDBC Copy linkLink copied to clipboard!
Access databases through SQL and JDBC.
3.47.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.
3.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-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jdbc</artifactId>
</dependency>
3.47.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.47.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").
3.47.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").
3.48. Jira Copy linkLink copied to clipboard!
Interact with JIRA issue tracker.
3.48.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.
3.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-jira</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jira</artifactId>
</dependency>
Applications using the camel-quarkus-jira extension require an additional Maven repository https://packages.atlassian.com/maven-external/ to be configured either in the Maven settings.xml file or in the pom.xml file of the application project.
3.48.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.
3.49. JMS Copy linkLink copied to clipboard!
Sent and receive messages to/from a JMS Queue or Topic.
3.49.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.
3.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-jms</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jms</artifactId>
</dependency>
3.49.3. Usage Copy linkLink copied to clipboard!
3.49.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.
3.49.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).
This extension automatically sets quarkus.camel.native.reflection.serialization-enabled = true for you. Refer to the native mode user guide for more information.
3.49.3.3. Support for Connection pooling and X/Open XA distributed transactions Copy linkLink copied to clipboard!
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.
We strongly recommend that you enable transaction recovery.
Since there currently exists no quarkus extension for ibmmq-client, you need to create a custom ConnectionFactory and wrap it yourself.
Here is an example:
Wrapper example: ConnectionFactory for ibmmq-client
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'.
you can ignore it and assume that MQ has discarded the transaction’s work. Refer to Red Hat Knowledgebase for more information.
3.49.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)
3.50. JPA Copy linkLink copied to clipboard!
Store and retrieve Java objects from databases using Java Persistence API (JPA).
3.50.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.
3.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-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jpa</artifactId>
</dependency>
3.50.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.
3.50.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.
3.51. JSLT Copy linkLink copied to clipboard!
Query or transform JSON payloads using an JSLT.
3.51.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.
3.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-jslt</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jslt</artifactId>
</dependency>
3.51.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.
3.51.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.51.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
3.51.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:
3.52. JSON Path Copy linkLink copied to clipboard!
Evaluate a JSONPath expression against a JSON message body
3.52.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-jsonpath</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jsonpath</artifactId>
</dependency>
3.53. JTA Copy linkLink copied to clipboard!
Enclose Camel routes in transactions using Java Transaction API (JTA) and Narayana transaction manager
3.53.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-jta</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jta</artifactId>
</dependency>
3.53.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. |
3.54. 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.
3.54.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.
3.54.2. Maven coordinates Copy linkLink copied to clipboard!
<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>
When using the native extension, you may get an error like
Resource bundle lookup must be loaded during native image generation:
Resource bundle lookup must be loaded during native image generation:
This is caused by missing native registration (https://github.com/apache/camel-quarkus/pull/6029)
As a workaround, you can include multiple resource bundles:
quarkus.native.additional-build-args = -H:IncludeResourceBundles=com.ibm.as400.access.JDMRI,-H:IncludeResourceBundles=com.ibm.as400.access.SVMRI_en,-H:IncludeResourceBundles=com.ibm.as400.access.MRI2,-H:IncludeResourceBundles=com.ibm.as400.access.JDMRI2,-H:IncludeResourceBundles=com.ibm.as400.access.SVMRI,-H:IncludeResourceBundles=com.ibm.as400.data.DAMRI,-H:IncludeResourceBundles=com.ibm.as400.security.SecurityMRI,-H:IncludeResourceBundles=com.ibm.as400.util.commtrace.CTMRI,-H:IncludeResourceBundles=com.ibm.as400.access.CoreMRI,-H:IncludeResourceBundles=com.ibm.as400.resource.ResourceMRI,-H:IncludeResourceBundles=com.ibm.as400.access.MRI
quarkus.native.additional-build-args = -H:IncludeResourceBundles=com.ibm.as400.access.JDMRI,-H:IncludeResourceBundles=com.ibm.as400.access.SVMRI_en,-H:IncludeResourceBundles=com.ibm.as400.access.MRI2,-H:IncludeResourceBundles=com.ibm.as400.access.JDMRI2,-H:IncludeResourceBundles=com.ibm.as400.access.SVMRI,-H:IncludeResourceBundles=com.ibm.as400.data.DAMRI,-H:IncludeResourceBundles=com.ibm.as400.security.SecurityMRI,-H:IncludeResourceBundles=com.ibm.as400.util.commtrace.CTMRI,-H:IncludeResourceBundles=com.ibm.as400.access.CoreMRI,-H:IncludeResourceBundles=com.ibm.as400.resource.ResourceMRI,-H:IncludeResourceBundles=com.ibm.as400.access.MRI
3.55. Kafka Copy linkLink copied to clipboard!
Sent and receive messages to/from an Apache Kafka broker.
3.55.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.
3.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-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kafka</artifactId>
</dependency>
3.55.3. Usage Copy linkLink copied to clipboard!
3.55.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.
3.55.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.
3.56. Kamelet Copy linkLink copied to clipboard!
Materialize route templates
3.56.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.
3.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-kamelet</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kamelet</artifactId>
</dependency>
3.56.3. Usage Copy linkLink copied to clipboard!
3.56.3.1. Pre-load Kamelets at build-time Copy linkLink copied to clipboard!
This extension allows to pre-load a set of Kamelets at build time using the quarkus.camel.kamelet.identifiers property.
3.56.3.2. Using the Kamelet Catalog Copy linkLink copied to clipboard!
A set of pre-made Kamelets can be found on the /camel-kamelets/latest[Kamelet Catalog]. To use the Kamelet from the catalog you need to copy their yaml definition (that you can find in the camel-kamelet repo) on your project in the classpath. Alternatively you can add the camel-kamelets-catalog artifact to your pom.xml:
<dependency>
<groupId>org.apache.camel.kamelets</groupId>
<artifactId>camel-kamelets-catalog</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.kamelets</groupId>
<artifactId>camel-kamelets-catalog</artifactId>
</dependency>
This artifact add all the kamelets available in the catalog to your Camel Quarkus application for build time processing. If you include it with the scope provided the artifact should not be part of the runtime classpath, but at build time, all the kamelets listed via quarkus.camel.kamelet.identifiers property should be preloaded.
3.56.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
| Configuration property | Type | Default |
|---|---|---|
|
List of kamelets identifiers to pre-load at build time.
Each individual identifier is used to set the related |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
3.57. Kubernetes Copy linkLink copied to clipboard!
Perform operations against Kubernetes API
3.57.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>
3.57.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.
3.57.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.
3.57.2.2. 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");
It’s possible to enable the kubernetes cluster service with a property like below:
quarkus.camel.cluster.kubernetes.enabled = true
quarkus.camel.cluster.kubernetes.enabled = true
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. |
|
|
|
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'). |
| |
|
Whether the camel master namespace leaders should be distributed evenly across all the camel contexts in the cluster. |
|
|
|
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.
3.58. Kudu Copy linkLink copied to clipboard!
Interact with Apache Kudu, a free and open source column-oriented data store of the Apache Hadoop ecosystem.
3.58.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.
3.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-kudu</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kudu</artifactId>
</dependency>
3.58.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.
Kudu is not supported for IBM Z and IBM Power.
3.59. Language Copy linkLink copied to clipboard!
Execute scripts in any of the languages supported by Camel.
3.59.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.
3.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-language</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-language</artifactId>
</dependency>
3.59.3. Usage Copy linkLink copied to clipboard!
3.59.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.
3.59.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
3.59.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.
3.60. LDAP Copy linkLink copied to clipboard!
Perform searches on LDAP servers.
3.60.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.
3.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-ldap</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-ldap</artifactId>
</dependency>
3.60.3. Usage Copy linkLink copied to clipboard!
3.60.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.
}
3.61. LRA Copy linkLink copied to clipboard!
Camel saga binding for Long-Running-Action framework
3.61.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-lra</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-lra</artifactId>
</dependency>
3.62. Log Copy linkLink copied to clipboard!
Log messages to the underlying logging mechanism.
3.62.1. What’s inside Copy linkLink copied to clipboard!
-
Log component, URI syntax:
log:loggerName
Refer to the above link for usage and configuration details.
3.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-log</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-log</artifactId>
</dependency>
3.63. 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.
3.63.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.
3.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-mail</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mail</artifactId>
</dependency>
3.64. Management Copy linkLink copied to clipboard!
JMX management strategy and associated managed resources.
3.64.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>
3.64.2. Usage Copy linkLink copied to clipboard!
For information on using Managed Beans in Camel, consult the JMX section of the Camel Manual.
3.64.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.
3.64.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.
3.65. MapStruct Copy linkLink copied to clipboard!
Type Conversion using Mapstruct
3.65.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.
3.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-mapstruct</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mapstruct</artifactId>
</dependency>
3.65.3. Usage Copy linkLink copied to clipboard!
3.65.3.1. Annotation Processor Copy linkLink copied to clipboard!
To use MapStruct, you must configure your build to use an annotation processor.
3.65.3.1.1. Maven Copy linkLink copied to clipboard!
3.65.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}'
}
3.65.3.2. Mapper definition discovery Copy linkLink copied to clipboard!
By default, Red Hat build of Apache Camel for Quarkus 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
3.66. 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.
3.66.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.
3.66.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>
3.66.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
This extension can be used in conjunction with extensions below:
3.67. Micrometer Copy linkLink copied to clipboard!
Collect various metrics directly from Camel routes using the Micrometer library.
3.67.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.
3.67.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>
3.67.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.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
If no dependency is declared, the Micrometer extension creates a SimpleMeterRegistry instance, suitable mainly for testing.
3.67.4. Camel Quarkus limitations Copy linkLink copied to clipboard!
3.67.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.
3.67.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.
3.67.4.3. Exposing statistics in JMX Copy linkLink copied to clipboard!
In Red Hat build of Apache Camel for Quarkus, 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.
3.67.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. |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
If you are migrating to micrometer from smallrye-metrics, you may need to manually define some beans as scoped.
In smallrye-metrics, classes that are registered for metrics (for example with @COUNTED, @METRIC), but not registered as scoped beans, are registered automatically. This does not happen in micrometer.
In micrometer you need to manually register beans accessed via CDI, by for example adding a @Dependent annotation.
3.68. Microprofile Fault Tolerance Copy linkLink copied to clipboard!
Circuit Breaker EIP using Microprofile Fault Tolerance
3.68.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-microprofile-fault-tolerance</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
</dependency>
3.69. MicroProfile Health Copy linkLink copied to clipboard!
Expose Camel health checks via MicroProfile Health
3.69.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-microprofile-health</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-health</artifactId>
</dependency>
3.69.3. Usage Copy linkLink copied to clipboard!
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.
3.69.3.1. Provided health checks Copy linkLink copied to clipboard!
Some checks are automatically registered for your application.
3.69.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'.
3.69.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'.
3.69.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.
3.70. Minio Copy linkLink copied to clipboard!
Store and retrieve objects from Minio Storage Service using Minio SDK.
3.70.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.
3.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-minio</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-minio</artifactId>
</dependency>
3.70.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
3.71. MLLP Copy linkLink copied to clipboard!
Communicate with external systems using the MLLP protocol.
3.71.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.
3.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-mllp</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mllp</artifactId>
</dependency>
3.71.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.
3.72. Mock Copy linkLink copied to clipboard!
Test routes and mediation rules using mocks.
3.72.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.
3.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-mock</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mock</artifactId>
</dependency>
3.72.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:
3.72.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).
3.73. MongoDB Copy linkLink copied to clipboard!
Perform operations on MongoDB documents and collections.
3.73.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.
3.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-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-mongodb</artifactId>
</dependency>
3.73.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.
3.74. MyBatis Copy linkLink copied to clipboard!
Performs a query, poll, insert, update or delete in a relational database using MyBatis.
3.74.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.
3.74.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>
3.74.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.
3.75. Netty HTTP Copy linkLink copied to clipboard!
The Netty HTTP extension provides HTTP transport on top of the Netty extension.
3.75.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.
3.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-netty-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-netty-http</artifactId>
</dependency>
3.75.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)
3.75.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.
3.76. Netty Copy linkLink copied to clipboard!
Socket level networking using TCP or UDP with Netty 4.x.
3.76.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.
3.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-netty</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-netty</artifactId>
</dependency>
3.77. OpenAPI Java Copy linkLink copied to clipboard!
Expose OpenAPI resources defined in Camel REST DSL
3.77.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-openapi-java</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-openapi-java</artifactId>
</dependency>
3.77.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.
3.78. OpenTelemetry Copy linkLink copied to clipboard!
Distributed tracing using OpenTelemetry
3.78.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-opentelemetry</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-opentelemetry</artifactId>
</dependency>
3.78.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:*
3.78.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.
3.78.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.
3.78.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 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/.* |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
3.79. Paho MQTT5 Copy linkLink copied to clipboard!
Communicate with MQTT message brokers using Eclipse Paho MQTT v5 Client.
3.79.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.
3.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-paho-mqtt5</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-paho-mqtt5</artifactId>
</dependency>
3.80. Paho Copy linkLink copied to clipboard!
Communicate with MQTT message brokers using Eclipse Paho MQTT Client.
3.80.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.
3.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-paho</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-paho</artifactId>
</dependency>
3.81. 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.
3.81.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.
3.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-platform-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-platform-http</artifactId>
</dependency>
3.81.3. Usage Copy linkLink copied to clipboard!
3.81.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}"));
3.81.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:
3.81.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:
3.81.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.
3.81.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 + "}");
3.81.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.81.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.
3.81.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.
3.82. Quartz Copy linkLink copied to clipboard!
Schedule sending of messages using the Quartz 2.x scheduler.
3.82.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.
3.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-quartz</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-quartz</artifactId>
</dependency>
3.82.3. Usage Copy linkLink copied to clipboard!
3.82.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.
3.83. Ref Copy linkLink copied to clipboard!
Route messages to an endpoint looked up dynamically by name in the Camel Registry.
3.83.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.
3.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-ref</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-ref</artifactId>
</dependency>
3.83.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:
3.84. REST OpenApi Copy linkLink copied to clipboard!
Configure REST producers based on an OpenAPI specification document delegating to a component implementing the RestProducerFactory interface.
3.84.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.
3.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-rest-openapi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest-openapi</artifactId>
</dependency>
3.84.3. Usage Copy linkLink copied to clipboard!
3.84.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
3.85. Rest Copy linkLink copied to clipboard!
Expose REST services and their OpenAPI Specification or call external REST services.
3.85.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.
3.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-rest</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest</artifactId>
</dependency>
3.85.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.
3.85.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.
3.85.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:
3.86. Salesforce Copy linkLink copied to clipboard!
Communicate with Salesforce using Java DTOs.
3.86.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.
3.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-salesforce</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-salesforce</artifactId>
</dependency>
3.86.3. Usage Copy linkLink copied to clipboard!
3.86.3.1. Generating Salesforce DTOs with the salesforce-maven-plugin Copy linkLink copied to clipboard!
Test content.
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.
3.86.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.
3.86.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.
3.87. Saga Copy linkLink copied to clipboard!
Execute custom actions within a route using the Saga EIP.
3.87.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.
3.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-saga</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-saga</artifactId>
</dependency>
3.88. SAP Copy linkLink copied to clipboard!
Provides SAP Camel Component
3.88.1. What’s inside Copy linkLink copied to clipboard!
The SAP extension is a package consisting of ten different SAP components. There are remote function call (RFC) components that support the sRFC, tRFC, and qRFC protocols and there are IDoc components that facilitate communication using messages in IDoc format. The component uses the SAP Java Connector (SAP JCo) library to facilitate bidirectional communication with SAP and the SAP IDoc library to transmit the documents in the Intermediate Document (IDoc) format.
See below for details.
3.88.2. 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>
3.88.2.1. SAP Extension 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".
3.88.2.2. Additional platform restrictions for the SAP component Copy linkLink copied to clipboard!
Because the SAP component depends on the third-party JCo 3 and IDoc 3 libraries, it can only be installed on the platforms that these libraries support.
3.88.2.3. SAP JCo and SAP IDoc libraries Copy linkLink copied to clipboard!
A prerequisite for using the SAP component is that the SAP Java Connector (SAP JCo) libraries and the SAP IDoc library are installed into the lib/ directory of the Java runtime. You must make sure that you download the appropriate set of SAP libraries for your target operating system from the SAP Service Marketplace.
The names of the library files vary depending on the target operating system, as shown below.
| SAP Component | Linux and UNIX | Windows |
|---|---|---|
| SAP JCo 3 |
|
|
| SAP IDoc |
|
|
In order to pull the correct SAP libraries, you must include the following dependencies in your pom.xml
3.88.3. URI format Copy linkLink copied to clipboard!
There are two different kinds of endpoint provided by the SAP component: the Remote Function Call (RFC) endpoints, and the Intermediate Document (IDoc) endpoints.
The URI formats for the RFC endpoints are as follows:
sap-srfc-destination:destinationName:rfcName sap-trfc-destination:destinationName:rfcName sap-qrfc-destination:destinationName:queueName:rfcName sap-srfc-server:serverName:rfcName[?options] sap-trfc-server:serverName:rfcName[?options]
sap-srfc-destination:destinationName:rfcName
sap-trfc-destination:destinationName:rfcName
sap-qrfc-destination:destinationName:queueName:rfcName
sap-srfc-server:serverName:rfcName[?options]
sap-trfc-server:serverName:rfcName[?options]
The URI formats for the IDoc endpoints are as follows:
sap-idoc-destination:destinationName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]] sap-idoclist-destination:destinationName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]] sap-qidoc-destination:destinationName:queueName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]] sap-qidoclist-destination:destinationName:queueName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]] sap-idoclist-server:serverName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]][?options]
sap-idoc-destination:destinationName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]]
sap-idoclist-destination:destinationName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]]
sap-qidoc-destination:destinationName:queueName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]]
sap-qidoclist-destination:destinationName:queueName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]]
sap-idoclist-server:serverName:idocType[:idocTypeExtension[:systemRelease[:applicationRelease]]][?options]
The URI formats prefixed by sap-endpointKind-destination are used to define destination endpoints (in other words, Camel producer endpoints) and destinationName is the name of a specific outbound connection to an SAP instance. Outbound connections are named and configured at the component level.
The URI formats prefixed by sap-endpointKind-server are used to define server endpoints (in other words, Camel consumer endpoints) and serverName is the name of a specific inbound connection from an SAP instance. Inbound connections are named and configured at the component level.
The other components of an RFC endpoint URI are as follows:
- rfcName
- (Required) In a destination endpoint URI, is the name of the RFC invoked by the endpoint in the connected SAP instance. In a server endpoint URI, is the name of the RFC handled by the endpoint when invoked from the connected SAP instance.
- queueName
- Specifies the queue this endpoint sends an SAP request to.
The other components of an IDoc endpoint URI are as follows:
- idocType
- (Required) Specifies the Basic IDoc Type of an IDoc produced by this endpoint.
- idocTypeExtension
- Specifies the IDoc Type Extension, if any, of an IDoc produced by this endpoint.
- systemRelease
- Specifies the associated SAP Basis Release, if any, of an IDoc produced by this endpoint.
- applicationRelease
- Specifies the associated Application Release, if any, of an IDoc produced by this endpoint.
- queueName
- Specifies the queue this endpoint sends an SAP request to.
3.88.3.1. Options for RFC destination endpoints Copy linkLink copied to clipboard!
The RFC destination endpoints (sap-srfc-destination, sap-trfc-destination, and sap-qrfc-destination) support the following URI options:
| Name | Default | Description |
|---|---|---|
|
|
|
If |
|
|
|
If |
3.88.3.2. Options for RFC server endpoints Copy linkLink copied to clipboard!
The SAP RFC server endpoints (sap-srfc-server and sap-trfc-server) support the following URI options:
| Name | Default | Description |
|---|---|---|
|
|
|
If |
|
|
|
(sap-trfc-server endpoint only) If |
3.88.3.3. Options for the IDoc List Server endpoint Copy linkLink copied to clipboard!
The SAP IDoc List Server endpoint (sap-idoclist-server) supports the following URI options:
| Name | Default | Description |
|---|---|---|
|
|
|
If |
|
|
|
If |
3.88.3.4. Summary of the RFC and IDoc endpoints Copy linkLink copied to clipboard!
The SAP component package provides the following RFC and IDoc endpoints:
sap-srfc-destinationCamel SAP Synchronous Remote Function Call Destination Camel component. This endpoint should be used in cases where Camel routes require synchronous delivery of requests to and responses from an SAP system.
NoteThe sRFC protocol used by this component delivers requests and responses to and from an SAP system, using best effort. In case of a communication error while sending a request, the completion status of a remote function call in the receiving SAP system remains in doubt.
sap-trfc-destinationCamel SAP Transactional Remote Function Call Destination Camel component. This endpoint should be used in cases where requests must be delivered to the receiving SAP system at most once. To accomplish this, the component generates a transaction ID,
tid, which accompanies every request sent through the component in a route’s exchange. The receiving SAP system records thetidaccompanying a request before delivering the request; if the SAP system receives the request again with the sametidit will not deliver the request. Thus if a route encounters a communication error when sending a request through an endpoint of this component, it can retry sending the request within the same exchange knowing it will be delivered and executed only once.NoteThe tRFC protocol used by this component is asynchronous and does not return a response. Thus the endpoints of this component do not return a response message.
NoteThis component does not guarantee the order of a series of requests through its endpoints, and the delivery and execution order of these requests may differ on the receiving SAP system due to communication errors and resends of a request. For guaranteed delivery order, please see the Camel SAP Queued Remote Function Call Destination Camel component.
sap-qrfc-destinationCamel SAP Queued Remote Function Call Destination Camel component. This component extends the capabilities of the Transactional Remote Function Call Destination camel component by adding in order delivery guarantees to the delivery of requests through its endpoints. This endpoint should be used in cases where a series of requests depend on each other and must be delivered to the receiving SAP system at most once and in order. The component accomplishes the at most once delivery guarantees using the same mechanisms as the Camel SAP Transactional Remote Function Call Destination Camel component. The ordering guarantee is accomplished by serializing the requests in the order they are received by the SAP system to an inbound queue. Inbound queues are processed by the QIN scheduler within SAP. When the inbound queue is activated, the QIN Scheduler will execute the queue requests in order.
NoteThe qRFC protocol used by this component is asynchronous and does not return a response. Thus the endpoints of this component do not return a response message.
sap-srfc-server- Camel SAP Synchronous Remote Function Call Server Camel component. This component and its endpoints should be used in cases where a Camel route is required to synchronously handle requests from and responses to an SAP system.
sap-trfc-server-
Camel SAP Transactional Remote Function Call Server Camel component. This endpoint should be used in cases where the sending SAP system requires at most once delivery of its requests to a Camel route. To accomplish this, the sending SAP system generates a transaction ID,
tid, which accompanies every request it sends to the component’s endpoints. The sending SAP system will first check with the component whether a giventidhas been received by it before sending a series of requests associated with thetid. The component will check the list of receivedtids it maintains, record the senttidif it is not in that list, and then respond to the sending SAP system, indicating whether or not thetidhas already been recorded. The sending SAP system will only then send the series of requests, if thetidhas not been previously recorded. This enables a sending SAP system to reliably send a series of requests once to a camel route. sap-idoc-destination- Camel SAP IDoc Destination Camel component. This endpoint should be used in cases where a Camel route sends a list of Intermediate Documents (IDocs) to an SAP system.
sap-idoclist-destination- Camel SAP IDoc List Destination Camel component. This endpoint should be used in cases where a Camel route sends a list of Intermediate documents (IDocs) list to an SAP system.
sap-qidoc-destination- Camel SAP Queued IDoc Destination Camel component. This component and its endpoints should be used in cases where a Camel route is required to send a list of Intermediate documents (IDocs) to an SAP system in order.
sap-qidoclist-destination- Camel SAP Queued IDoc List Destination Camel component. This component and its endpoints are used in cases where a camel route sends the Intermediate documents (IDocs) list to an SAP system in order.
sap-idoclist-server-
Camel SAP IDoc List Server Camel component. This endpoint should be used in cases where a sending SAP system requires delivery of Intermediate Document lists to a Camel route. This component uses the tRFC protocol to communicate with SAP as described in the
sap-trfc-server-standalonequick start.
3.88.3.5. SAP RFC destination endpoint Copy linkLink copied to clipboard!
An RFC destination endpoint supports outbound communication to SAP, which enable these endpoints to make RFC calls out to ABAP function modules in SAP. An RFC destination endpoint is configured to make an RFC call to a specific ABAP function over a specific connection to an SAP instance. An RFC destination is a logical designation for an outbound connection and has a unique name. An RFC destination is specified by a set of connection parameters called destination data.
An RFC destination endpoint will extract an RFC request from the input message of the IN-OUT exchanges it receives and dispatch that request in a function call to SAP. The response from the function call will be returned in the output message of the exchange. Since SAP RFC destination endpoints only support outbound communication, an RFC destination endpoint only supports the creation of producers.
3.88.3.6. SAP RFC server endpoint Copy linkLink copied to clipboard!
An RFC server endpoint supports inbound communication from SAP, which enables ABAP applications in SAP to make RFC calls into server endpoints. An ABAP application interacts with an RFC server endpoint as if it were a remote function module. An RFC server endpoint is configured to receive an RFC call to a specific RFC function over a specific connection from an SAP instance. An RFC server is a logical designation for an inbound connection and has a unique name. An RFC server is specified by a set of connection parameters called server data.
An RFC server endpoint will handle an incoming RFC request and dispatch it as the input message of an IN-OUT exchange. The output message of the exchange will be returned as the response of the RFC call. Since SAP RFC server endpoints only support inbound communication, an RFC server endpoint only supports the creation of consumers.
3.88.3.7. SAP IDoc and IDoc list destination endpoints Copy linkLink copied to clipboard!
An IDoc destination endpoint supports outbound communication to SAP, which can then perform further processing on the IDoc message. An IDoc document represents a business transaction, which can easily be exchanged with non-SAP systems. An IDoc destination is specified by a set of connection parameters called destination data.
An IDoc list destination endpoint is similar to an IDoc destination endpoint, except that the messages it handles consist of a list of IDoc documents.
3.88.3.8. SAP IDoc list server endpoint Copy linkLink copied to clipboard!
An IDoc list server endpoint supports inbound communication from SAP, enabling a Camel route to receive a list of IDoc documents from an SAP system. An IDoc list server is specified by a set of connection parameters called server data.
3.88.3.9. Metadata repositories Copy linkLink copied to clipboard!
A metadata repository is used to store the following kinds of metadata:
- Interface descriptions of function modules
- This metadata is used by the JCo and ABAP runtimes to check RFC calls to ensure the type-safe transfer of data between communication partners before dispatching those calls. A repository is populated with repository data. Repository data is a map of named function templates. A function template contains the metadata describing all the parameters and their typing information passed to and from a function module and has the unique name of the function module it describes.
- IDoc type descriptions
- This metadata is used by the IDoc runtime to ensure that the IDoc documents are correctly formatted before being sent to a communication partner. A basic IDoc type consists of a name, a list of permitted segments, and a description of the hierarchical relationship between the segments. Some additional constraints can be imposed on the segments: a segment can be mandatory or optional; and it is possible to specify a minimum/maximum range for each segment (defining the number of allowed repetitions of that segment).
SAP destination and server endpoints thus require access to a repository, in order to send and receive RFC calls and in order to send and receive IDoc documents. For RFC calls, the metadata for all function modules invoked and handled by the endpoints must reside within the repository; and for IDoc endpoints, the metadata for all IDoc types and IDoc type extensions handled by the endpoints must reside within the repository. The location of the repository used by a destination and server endpoint is specified in the destination data and the server data of their respective connections.
In the case of an SAP destination endpoint, the repository it uses typically resides in an SAP system, and it defaults to the SAP system it is connected to. This default requires no explicit configuration in the destination data. Furthermore, the metadata for the remote function call that a destination endpoint makes will already exist in a repository for any existing function module that it calls. The metadata for calls made by destination endpoints thus require no configuration in the SAP component.
On the other hand, the metadata for function calls handled by server endpoints do not typically reside in the repository of an SAP system and must instead be provided by a repository residing in the SAP component. The SAP component maintains a map of named metadata repositories. The name of a repository corresponds to the name of the server to which it provides metadata.
3.88.4. Configuration Copy linkLink copied to clipboard!
The SAP component maintains three maps to store destination data, server data, and repository data. The destination data store and the server data store are configured on a special configuration object, SapConnectionConfiguration, which automatically gets injected into the SAP component. The repository data store must be configured directly on the relevant SAP component.
3.88.4.1. Configuration Overview Copy linkLink copied to clipboard!
The SAP component maintains three maps to store destination data, server data, and repository data. The component’s property, destinationDataStore, stores destination data keyed by destination name, the property, serverDataStore, stores server data keyed by server name and the property, repositoryDataStore, stores repository data keyed by repository name. These configurations must be passed to the component during its initialization.
Example
The following example shows how to configure a sample destination data store and a sample server data store. The sap-configuration bean (of type SapConnectionConfiguration) will be automatically injected into any SAP component that is used in this application.
The values can be supplied from the application.properties file. In that case, you can use the property name instead of the hardcoded value.
For example:
ConfigProvider.getConfig().getValue("<property name>", String.class)
3.88.4.2. Destination Configuration Copy linkLink copied to clipboard!
The configurations for destinations are maintained in the destinationDataStore property of the SAP component. Each entry in this map configures a distinct outbound connection to an SAP instance. The key for each entry is the name of the outbound connection and is used in the destinationName component of a destination endpoint URI as described in the URI format section.
The value for each entry is a destination data configuration object - org.fusesource.camel.component.sap.model.rfc.impl.DestinationDataImpl - that specifies the configuration of an outbound SAP connection.
Sample destination configuration
The following code shows how to configure a sample destination with the name, quickstartDest:
After configuring the destination as shown above, you can invoke the BAPI_FLCUST_GETLIST remote function call on the quickstartDest destination with the following URI:
sap-srfc-destination:quickstartDest:BAPI_FLCUST_GETLIST
sap-srfc-destination:quickstartDest:BAPI_FLCUST_GETLIST
3.88.4.2.1. Interceptor for tRFC and qRFC destinations Copy linkLink copied to clipboard!
The preceding sample destination configuration shows the instantiation of a CurrentProcessorDefinitionInterceptStrategy object. This object installs an interceptor in the Camel runtime, which enables the Camel SAP component to keep track of its position within a Camel route while it is handling RFC transactions.
This interceptor is critically important for transactional RFC destination endpoints (such as sap-trfc-destination and sap-qrfc-destination) and must be installed in the Camel runtime for outbound transactional RFC communication to be properly managed. The Destination RFC Transaction Handlers issues warnings into the Camel log if the strategy is not found at runtime. In this situation the Camel runtime will need to be re-provisioned and restarted to properly manage outbound transactional RFC communication.
3.88.4.2.2. Log on and authentication options Copy linkLink copied to clipboard!
The following table lists the log on and authentication options for configuring a destination in the SAP destination data store:
| Name | Default Value | Description |
|
| SAP client, mandatory log on parameter. | |
|
| log on user, log on parameter for password based authentication. | |
|
| log on user alias, can be used instead of log on user. | |
|
| User identity used for log on to the ABAP AS. Used by the JCo runtime, if the destination configuration uses SSO/assertion ticket, certificate, current user ,or SNC environment for authentication. The user ID is mandatory, if neither user nor user alias is set. This ID will never be sent to the SAP backend, it will be used by the JCo runtime locally. | |
|
| log on password, log on parameter for password based authentication. | |
|
| log on language, if not defined, the default user language is used. | |
|
| Use the specified SAP Cookie Version 2 as a log on ticket for SSO based authentication. | |
|
| Use the specified X509 certificate for certificate based authentication. | |
|
| Postpone the authentication until the first call - 1 (enable). Used in special cases only. | |
|
| Use a visible, hidden, or do not use SAP GUI | |
|
| Additional log on parameter to define the codepage used to convert the log on parameters. Used in special cases only. | |
|
| Order an SSO ticket after log on, the obtained ticket is available in the destination attributes. | |
|
|
If set to |
3.88.4.2.3. Connection options Copy linkLink copied to clipboard!
The following table lists the connection options for configuring a destination in the SAP destination data store:
| Name | Default Value | Description |
|
|
SAP Router string for connection to systems behind a SAP Router. SAP Router string contains the chain of SAP Routers and theirs port numbers and has the form: | |
|
| System number of the SAP ABAP application server, mandatory for a direct connection. | |
|
| SAP ABAP application server, mandatory for a direct connection. | |
|
| SAP message server, mandatory property for a load balancing connection. | |
|
|
SAP message server port, optional property for a load balancing connection. In order to resolve the service names sapmsXXX a lookup in | |
|
| Allows specifying a concrete gateway, which should be used for establishing the connection to an application server. If not specified, the gateway on the application server is used. | |
|
| Should be set, when using gwhost. Allows specifying the port used on that gateway. If not specified, the port of the gateway on the application server is used. In order to resolve the service names sapgwXXX a lookup in etc/services is performed by the network layer of the operating system. If using port numbers instead of symbolic service names, no lookups are performed and no additional entries are needed. | |
|
| System ID of the SAP system, mandatory property for a load balancing connection. | |
|
| Group of SAP application servers, mandatory property for a load balancing connection. | |
|
|
|
Set this value depending on the network quality between JCo and your target system to optimize performance. The valid values are |
|
|
|
The valid values are |
3.88.4.2.4. Connection pool options Copy linkLink copied to clipboard!
The following table lists the connection pool options for configuring a destination in the SAP destination data store:
| Name | Default Value | Description |
|
|
|
Maximum number of active outbound connections that can be created for a destination simultaneously. A value of |
|
|
|
Maximum number of idle outbound connections kept open by the destination. A value of |
|
| Time in milliseconds after which a free connection held internally by the destination can be closed. | |
|
| Period in milliseconds after which the destination checks the released connections for expiration. | |
|
| Maximum time in milliseconds to wait for a connection, if the maximum allowed number of connections has already been allocated by the application. |
3.88.4.2.5. Secure network connection options Copy linkLink copied to clipboard!
The following table lists the secure network options for configuring a destination in the SAP destination data store:
| Name | Default Value | Description |
|
|
Secure network connection (SNC) mode, | |
|
|
SNC partner, for example: | |
|
|
SNC level of security: | |
|
| Own SNC name. Overrides the environment settings. | |
|
| Path to the library that provides the SNC service. |
3.88.4.2.6. Repository options Copy linkLink copied to clipboard!
The following table lists the repository options for configuring a destination in the SAP destination data store:
| Name | Default Value | Description |
|
| Specifies the destination which is used as a repository. | |
|
| If a repository destination is not set, and this property is set, it is used as user for repository calls. This enables you to use a different user for repository lookups. | |
|
| The password for a repository user. Mandatory, if a repository user is used. | |
|
|
(Optional) If SNC is used for this destination, it is possible to turn it off for repository connections, if this property is set to | |
|
|
Enable the
If the property is not set, the destination initially does a remote call to check whether Note: If the repository is already initialized (for example, because it is used by some other destination), this property does not have any effect. Generally, this property is related to the ABAP System, and should have the same value on all destinations pointing to the same ABAP System. See note 1456826 for backend prerequisites. |
3.88.4.2.7. Trace configuration options Copy linkLink copied to clipboard!
The following table lists the trace configuration options for configuring a destination in the SAP destination data store:
| Name | Default Value | Description |
|
|
Enable/disable RFC trace ( | |
|
|
Enable/disable CPIC trace |
3.88.4.3. Server Configuration Copy linkLink copied to clipboard!
The configurations for servers are maintained in the serverDataStore property of the SAP component. Each entry in this map configures a distinct inbound connection from an SAP instance. The key for each entry is the name of the outbound connection and is used in the serverName component of a server endpoint URI as described in the URI format section.
The value for each entry is a server data configuration object, org.fusesource.camel.component.sap.model.rfc.impl.ServerDataImpl, which defines the configuration of an inbound SAP connection.
Sample server configuration
The following code shows how to create a sample server configuration with the name, quickstartServer.
This example also configures a destination connection, quickstartDest, which the server uses to retrieve metadata from a remote SAP instance. This destination is configured in the server data through the repositoryDestination option. If you do not configure this option, you must create a local metadata repository instead.
After configuring the destination as shown above, you can handle the BAPI_FLCUST_GETLIST remote function call on the quickstartDest remote function call from an invoking client, using the following URI:
sap-srfc-server:quickstartServer:BAPI_FLCUST_GETLIST
sap-srfc-server:quickstartServer:BAPI_FLCUST_GETLIST
3.88.4.3.1. Required options Copy linkLink copied to clipboard!
The required options for the server data configuration object are, as follows:
| Name | Default Value | Description |
|
| Gateway host on which the server connection should be registered. | |
|
|
Gateway service, which is the port on which a registration can be done. In order to resolve the service names | |
|
| The program ID with which the registration is done. Serves as an identifier on the gateway and in the destination in the ABAP system. | |
|
| Specifies a destination name that the server can use in order to retrieve metadata from a metadata repository hosted in a remote SAP server. | |
|
| The number of connections that should be registered at the gateway. |
3.88.4.3.2. Secure network connection options Copy linkLink copied to clipboard!
The secure network connection options for the server data configuration object are as follows:
| Name | Default Value | Description |
|
|
Secure network connection (SNC) mode, | |
|
|
SNC level of security, | |
|
|
SNC name of your server. Overrides the default SNC name. Typically something like | |
|
|
Path to library which provides SNC service. If this property is not provided, the value of the |
3.88.4.3.3. Other options Copy linkLink copied to clipboard!
The other options for the server data configuration object are, as follows:
| Name | Default Value | Description |
|
|
SAP router string to use for a system protected by a firewall, which can therefore only be reached through a SAProuter, when registering the server at the gateway of that ABAP System. A typical router string is | |
|
| The maximum time (in seconds) between two start-up attempts in case of failures. The waiting time is doubled from initially 1 second after each start-up failure until either the maximum value is reached or the server could be started successfully. | |
|
|
Enable/disable RFC trace ( | |
|
|
The maximum number of threads used by the server connection. If not set, the value for the | |
|
|
The minimum number of threads used by server connection. If not set, the value for |
3.88.4.4. Repository Configuration Copy linkLink copied to clipboard!
The configurations for repositories are maintained in the repositoryDataStore property of the SAP Component. Each entry in this map configures a distinct repository. The key for each entry is the name of the repository and this key also corresponds to the name of the server to which this repository is attached.
The value of each entry is a repository data configuration object, org.fusesource.camel.component.sap.model.rfc.impl.RepositoryDataImpl, that defines the contents of a metadata repository. A repository data object is a map of function template configuration objects, org.fuesource.camel.component.sap.model.rfc.impl.FunctionTemplateImpl. Each entry in this map specifies the interface of a function module and the key for each entry is the name of the function module specified.
Repository data example
The following code shows a simple example of configuring a metadata repository:
3.88.4.4.1. Function template properties Copy linkLink copied to clipboard!
The interface of a function module consists of four parameter lists by which data is transferred back and forth to the function module in an RFC call. Each parameter list consists of one or more fields, each of which is a named parameter transferred in an RFC call. The following parameter lists and exception list are supported:
- The import parameter list contains parameter values sent to a function module in an RFC call;
- The export parameter list contains parameter values that are returned by a function module in an RFC call;
- The changing parameter list contains parameter values sent to and returned by a function module in an RFC call;
- The table parameter list contains internal table values sent to and returned by a function module in an RFC call.
- The interface of a function module also consists of an exception list of ABAP exceptions that may be raised when the module is invoked in an RFC call.
A function template describes the name and type of parameters in each parameter list of a function interface and the ABAP exceptions thrown by the function. A function template object maintains five property lists of metadata objects, as described in the following table.
| Property | Description |
|
|
A list of list field metadata objects, |
|
|
A list of list field metadata objects, |
|
|
A list of list field metadata objects, |
|
|
A list of list field metadata objects, |
|
|
A list of ABAP exception metadata objects, |
Function template example
The following example shows an outline of how to configure a function template:
3.88.4.4.2. List field metadata properties Copy linkLink copied to clipboard!
A list field metadata object, org.fusesource.camel.component.sap.model.rfc.impl.ListFieldMeataDataImpl, specifies the name and type of a field in a parameter list. For an elementary parameter field (CHAR, DATE, BCD, TIME, BYTE, NUM, FLOAT, INT, INT1, INT2, DECF16, DECF34, STRING, XSTRING), the following table lists the configuration properties that may be set on a list field metadata object:
| Name | Default Value | Description |
|
| - | The name of the parameter field. |
|
| - | The parameter type of the field. |
|
| - | The field length in bytes for a non-Unicode layout. This value depends on the parameter type. |
|
| - | The field length in bytes for a Unicode layout. This value depends on the parameter type. |
|
|
| The number of decimals in field value. Required for parameter types BCD and FLOAT. |
|
|
|
If |
Note that all elementary parameter fields require that the name, type, byteLength, and unicodeByteLength properties be specified in the field metadata object. In addition, the BCD, FLOAT, DECF16, and DECF34 fields require the decimal property to be specified in the field metadata object.
For a complex parameter field of type TABLE or STRUCTURE, the following table lists the configuration properties that may be set on a list field metadata object:
| Name | Default Value | Description |
|
| - | The name of the parameter field. |
|
| - | The parameter type of the field. |
|
| - |
The metadata for the structure or table. A record metadata object, |
|
|
|
If |
All complex parameter fields require that the name, type, and recordMetaData properties be specified in the field metadata object. The value of the recordMetaData property is a record field metadata object, org.fusesource.camel.component.sap.model.rfc.impl.RecordMetaDataImpl, which specifies the structure of a nested structure or the structure of a table row.
Elementary list field metadata example
The following metadata configuration specifies an optional, 24-digit packed BCD number parameter with two decimal places named TICKET_PRICE:
Complex list field metadata example
The following metadata configuration specifies a required TABLE parameter named CONNINFO with a row structure specified by the connectionInfo record metadata object:
ListFieldMetaData metaData = new ListFieldMetaDataImpl();
metaData.setName("CONNINFO");
metaData.setType(DataType.TABLE);
RecordMetaData connectionInfo = new RecordMetaDataImpl();
metaData.setRecordMetaData(connectionInfo);
ListFieldMetaData metaData = new ListFieldMetaDataImpl();
metaData.setName("CONNINFO");
metaData.setType(DataType.TABLE);
RecordMetaData connectionInfo = new RecordMetaDataImpl();
metaData.setRecordMetaData(connectionInfo);
3.88.4.4.3. Record metadata properties Copy linkLink copied to clipboard!
A record metadata object, org.fusesource.camel.component.sap.model.rfc.impl.RecordMetaDataImpl, specifies the name and contents of a nested STRUCTURE or the row of a TABLE parameter. A record metadata object maintains a list of record field metadata objects, org.fusesource.camel.component.sap.model.rfc.impl.FieldMetaDataImpl, which specifies the parameters that reside in the nested structure or table row.
The following table lists configuration properties that may be set on a record metadata object:
| Name | Default Value | Description |
|
| - | The name of the record. |
|
| - |
The list of record field metadata objects, |
All properties of the record metadata object are required.
Record metadata example
The following example shows how to configure a record metadata object:
RecordMetaData connectionInfo = new RecordMetaDataImpl();
connectionInfo.setName("CONNECTION_INFO");
connectionInfo.setRecordFieldMetaData(...);
RecordMetaData connectionInfo = new RecordMetaDataImpl();
connectionInfo.setName("CONNECTION_INFO");
connectionInfo.setRecordFieldMetaData(...);
3.88.4.4.4. Record field metadata properties Copy linkLink copied to clipboard!
A record field metadata object, org.fusesource.camel.component.sap.model.rfc.impl.FieldMetaDataImpl, specifies the name and type of a parameter field within a structure.
A record field metadata object is similar to a parameter field metadata object, except that the offsets of the individual field locations within the nested structure or table row must be additionally specified. The non-Unicode and Unicode offsets of an individual field must be calculated and specified from the sum of non-Unicode and Unicode byte lengths of the preceding fields in the structure or row.
The failure to properly specify the offsets of fields in nested structures and table rows will cause the field storage of parameters in the underlying JCo and ABAP runtimes to overlap and prevent the proper transfer of values in RFC calls.
For an elementary parameter field (CHAR, DATE, BCD, TIME, BYTE, NUM, FLOAT, INT, INT1, INT2, DECF16, DECF34, STRING, XSTRING), the following table lists the configuration properties that may be set on a record field metadata object:
| Name | Default Value | Description |
|
| - | The name of the parameter field. |
|
| - | The parameter type of the field. |
|
| - | The field length in bytes for a non-Unicode layout. This value depends on the parameter type. |
|
| - | The field length in bytes for a Unicode layout. This value depends on the parameter type. |
|
| - | The field offset in bytes for non-Unicode layout. This offset is the byte location of the field within the enclosing structure. |
|
| - | The field offset in bytes for Unicode layout. This offset is the byte location of the field within the enclosing structure. |
|
|
|
The number of decimals in field value; only required for parameter types |
For a complex parameter field of type TABLE or STRUCTURE, the following table lists the configuration properties that may be set on a record field metadata object:
| Name | Default Value | Description |
|
| - | The name of the parameter field. |
|
| - | The parameter type of the field. |
|
| - | The field offset in bytes for non-Unicode layout. This offset is the byte location of the field within the enclosing structure. |
|
| - | The field offset in bytes for Unicode layout. This offset is the byte location of the field within the enclosing structure. |
|
| - |
The metadata for the structure or table. A record metadata object, |
Elementary record field metadata example
The following metadata configuration specifies a DATE field parameter named ARRDATE located 85 bytes into the enclosing structure in the case of a non-Unicode layout and located 170 bytes into the enclosing structure in the case of a Unicode layout.
Complex record field metadata example
The following metadata configuration specifies a STRUCTURE field parameter named FLTINFO with a structure specified by the flightInfo record metadata object. The parameter is located at the beginning of the enclosing structure in both the case of a non-Unicode and Unicode layout.
3.88.5. Message Headers Copy linkLink copied to clipboard!
The SAP component supports the following message headers:
| Header | Description |
|
|
The URI scheme of the last endpoint to process the message. Use one of the following values:
|
|
| The destination name of the last destination endpoint to process the message. |
|
| The server name of the last server endpoint to process the message. |
|
| The queue name of the last queuing endpoint to process the message. |
|
| The RFC name of the last RFC endpoint to process the message. |
|
| The IDoc type of the last IDoc endpoint to process the message. |
|
| The IDoc type extension, if any, of the last IDoc endpoint to process the message. |
|
| The system release, if any, of the last IDoc endpoint to process the message. |
|
| The application release, if any, of the last IDoc endpoint to process the message. |
3.88.6. Exchange Properties Copy linkLink copied to clipboard!
The SAP component adds the following exchange properties:
| Property | Description |
|
|
A map containing the properties of each SAP destination encountered by the exchange. The map is keyed by destination name and each entry is a |
|
|
A map containing the properties of each SAP server encountered by the exchange. The map is keyed by server name and each entry is a |
3.88.7. Message Body for RFC Copy linkLink copied to clipboard!
3.88.7.1. Request and response objects Copy linkLink copied to clipboard!
An SAP endpoint expects to receive a message with a message body containing an SAP request object and will return a message with a message body containing an SAP response object. SAP requests and responses are fixed map data structures containing named fields with each field having a predefined data type.
Note that the named fields in an SAP request and response are specific to an SAP endpoint, with each endpoint defining the parameters in the SAP request and response it will accept. An SAP endpoint provides factory methods to create the request and response objects that are specific to it.
3.88.7.2. Structure objects Copy linkLink copied to clipboard!
Both SAP request and response objects are represented in Java as a structure object which supports the org.fusesource.camel.component.sap.model.rfc.Structure interface. This interface extends both the java.util.Map and org.eclipse.emf.ecore.EObject interfaces.
The field values in a structure object are accessed through the field’s getter methods in the map interface. In addition, the structure interface provides a type-restricted method to retrieve field values.
Structure objects are implemented in the component runtime using the Eclipse Modeling Framework (EMF) and support that framework’s EObject interface. Instances of a structure object have attached metadata which define and restrict the structure and contents of the map of fields it provides. This metadata can be accessed and introspected using the standard methods provided by EMF. Refer to the EMF documentation for further details.
Attempts to get a parameter not defined on a structure object will return null. Attempts to set a parameter not defined on a structure will throw an exception as well as attempts to set the value of a parameter with an incorrect type.
As discussed in the following sections, structure objects can contain fields that contain values of the complex field types, STRUCTURE, and TABLE.
It is unnecessary to create instances of these types and add them to the structure. Instances of these field values are created on demand if necessary when accessed in the enclosing structure.
3.88.7.3. Field types Copy linkLink copied to clipboard!
The fields that reside within the structure object of an SAP request or response may be either elementary or complex. An elementary field contains a single scalar value, whereas a complex field will contain one or more fields of either an elementary or complex type.
3.88.7.3.1. Elementary field types Copy linkLink copied to clipboard!
An elementary field may be a character, numeric, hexadecimal or string field type. The following table summarizes the types of elementary fields that may reside in a structure object:
| Field Type | Corresponding Java Type | Byte Length | Unicode Byte Length | Number Decimals Digits | Description |
|
|
| 1 to 65535 | 1 to 65535 | - | ABAP Type ‘C’: Fixed sized character string |
|
|
| 8 | 16 | - | ABAP Type ‘D’: Date (format: YYYYMMDD) |
|
|
| 1 to 16 | 1 to 16 | 0 to 14 | ABAP Type ‘P’: Packed BCD number. A BCD number contains two digits per byte. |
|
|
| 6 | 12 | - | ABAP Type ‘T’: Time (format: HHMMSS) |
|
|
| 1 to 65535 | 1 to 65535 | - | ABAP Type ‘X’:Fixed sized byte array |
|
|
| 1 to 65535 | 1 to 65535 | - | ABAP Type ‘N’: Fixed sized numeric character string |
|
|
| 8 | 8 | 0 to 15 | ABAP Type ‘F’: Floating point number |
|
|
| 4 | 4 | - | ABAP Type ‘I’: 4-byte Integer |
|
|
| 2 | 2 | - | ABAP Type ‘S’: 2-byte Integer |
|
|
| 1 | 1 | - | ABAP Type ‘B’: 1-byte Integer |
|
|
| 8 | 8 | 16 | ABAP Type ‘decfloat16’: 8 -byte Decimal Floating Point Number |
|
|
| 16 | 16 | 34 | ABAP Type ‘decfloat34’: 16-byte Decimal Floating Point Number |
|
|
| 8 | 8 | - | ABAP Type ‘G’: Variable length character string |
|
|
| 8 | 8 | - | ABAP Type ‘Y’: Variable length byte array |
3.88.7.3.2. Character field types Copy linkLink copied to clipboard!
A character field contains a fixed sized character string that may use either a non-Unicode or Unicode character encoding in the underlying JCo and ABAP runtimes. Non-Unicode character strings encode one character per byte. Unicode character strings are encoded in two bytes using UTF-16 encoding. Character field values are represented in Java as java.lang.String objects and the underlying JCo runtime is responsible for the conversion to their ABAP representation.
A character field declares its field length in its associated byteLength and unicodeByteLength properties, which determine the length of the field’s character string in each encoding system.
CHAR-
A
CHARcharacter field is a text field containing alphanumeric characters and corresponds to the ABAP type C. NUM-
A
NUMcharacter field is a numeric text field containing numeric characters only and corresponds to the ABAP type N. DATE-
A
DATEcharacter field is an 8 character date field with the year, month and day formatted asYYYYMMDDand corresponds to the ABAP type D. TIME-
A
TIMEcharacter field is a 6 character time field with the hours, minutes and seconds formatted asHHMMSSand corresponds to the ABAP type T.
3.88.7.3.3. Numeric field types Copy linkLink copied to clipboard!
A numeric field contains a number. The following numeric field types are supported:
INT-
An
INTnumeric field is an integer field stored as a 4-byte integer value in the underlying JCo and ABAP runtimes and corresponds to the ABAP type I. AnINTfield value is represented in Java as ajava.lang.Integerobject. INT2-
An
INT2numeric field is an integer field stored as a 2-byte integer value in the underlying JCo and ABAP runtimes and corresponds to the ABAP type S. AnINT2field value is represented in Java as ajava.lang.Integerobject. INT1-
An
INT1field is an integer field stored as a 1-byte integer value in the underlying JCo and ABAP runtimes value and corresponds to the ABAP type B. AnINT1field value is represented in Java as ajava.lang.Integerobject. FLOAT-
A
FLOATfield is a binary floating point number field stored as an 8-byte double value in the underlying JCo and ABAP runtimes and corresponds to the ABAP type F. AFLOATfield declares the number of decimal digits that the field’s value contains in its associated decimal property. In the case of aFLOATfield, this decimal property can have a value between 1 and 15 digits. AFLOATfield value is represented in Java as ajava.lang.Doubleobject. BCD-
A
BCDfield is a binary coded decimal field stored as a 1 to 16 byte packed number in the underlying JCo and ABAP runtimes and corresponds to the ABAP type P. A packed number stores two decimal digits per byte. ABCDfield declares its field length in its associatedbyteLengthandunicodeByteLengthproperties. In the case of aBCDfield, these properties can have a value between 1 and 16 bytes, and both properties will have the same value. ABCDfield declares the number of decimal digits that the field’s value contains in its associated decimal property. In the case of aBCDfield, this decimal property can have a value between 1 and 14 digits. ABCDfield value is represented in Java as ajava.math.BigDecimal. DECF16-
A
DECF16field is a decimal floating point stored as an 8-byte IEEE 754 decimal64 floating point value in the underlying JCo and ABAP runtimes and corresponds to the ABAP typedecfloat16. The value of aDECF16field has 16 decimal digits. The value of aDECF16field is represented in Java asjava.math.BigDecimal. DECF34-
A
DECF34field is a decimal floating point stored as a 16-byte IEEE 754 decimal128 floating point value in the underlying JCo and ABAP runtimes and corresponds to the ABAP typedecfloat34. The value of aDECF34field has 34 decimal digits. The value of aDECF34field is represented in Java asjava.math.BigDecimal.
3.88.7.3.4. Hexadecimal field types Copy linkLink copied to clipboard!
A hexadecimal field contains raw binary data. The following hexadecimal field types are supported:
BYTE-
A
BYTEfield is a fixed sized byte string stored as a byte array in the underlying JCo and ABAP runtimes and corresponds to the ABAP type X. ABYTEfield declares its field length in its associatedbyteLengthandunicodeByteLengthproperties. In the case of aBYTEfield, these properties can have a value between 1 and 65535 bytes and both properties will have the same value. The value of aBYTEfield is represented in Java as abyte[]object.
3.88.7.3.5. String field types Copy linkLink copied to clipboard!
A string field references a variable length string value. The length of that string value is not fixed until runtime. The storage for the string value is dynamically created in the underlying JCo and ABAP runtimes. The storage for the string field itself is fixed and contains only a string header.
STRING-
A
STRINGfield refers to a character string stored in the underlying JCo and ABAP runtimes as an 8-byte value. It corresponds to the ABAP type G. The value of theSTRINGfield is represented in Java as ajava.lang.Stringobject. XSTRING-
An
XSTRINGfield refers to a byte string stored in the underlying JCo and ABAP runtimes as an 8-byte value. It corresponds to the ABAP type Y. The value of theSTRINGfield is represented in Java as abyte[]object.
3.88.7.3.6. Complex field types Copy linkLink copied to clipboard!
A complex field may be either a structure or table field type. The following table summarizes these complex field types.
| Field Type | Corresponding Java Type | Byte Length | Unicode Byte Length | Number Decimals Digits | Description |
|
|
| Total of individual field byte lengths | Total of individual field Unicode byte lengths | - | ABAP Type ‘u’ & ‘v’: Heterogeneous Structure |
|
|
| Byte length of row structure | Unicode byte length of row structure | - | ABAP Type ‘h’: Table |
3.88.7.3.7. Structure field types Copy linkLink copied to clipboard!
A STRUCTURE field contains a structure object and is stored in the underlying JCo and ABAP runtimes as an ABAP structure record. It corresponds to either an ABAP type u or v. The value of a STRUCTURE field is represented in Java as a structure object with the interface org.fusesource.camel.component.sap.model.rfc.Structure.
3.88.7.3.8. Table field types Copy linkLink copied to clipboard!
A TABLE field contains a table object and is stored in the underlying JCo and ABAP runtimes as an ABAP internal table. It corresponds to the ABAP type h. The value of the field is represented in Java by a table object with the interface org.fusesource.camel.component.sap.model.rfc.Table.
3.88.7.3.9. Table objects Copy linkLink copied to clipboard!
A table object is a homogeneous list data structure containing rows of structure objects with the same structure. This interface extends both the java.util.List and org.eclipse.emf.ecore.EObject interfaces.
The list of rows in a table object is accessed and managed using the standard methods defined in the list interface. In addition, the table interface provides two factory methods for creating and adding structure objects to the row list.
Table objects are implemented in the component runtime using the Eclipse Modeling Framework (EMF) and support that framework’s EObject interface. Instances of a table object have attached metadata which define and restrict the structure and contents of the rows it provides. This metadata can be accessed and introspected using the standard methods provided by EMF. Refer to the EMF documentation for further details.
Attempts to add or set a row structure value of the wrong type will throw an exception.
3.88.8. Message Body for IDoc Copy linkLink copied to clipboard!
3.88.8.1. IDoc message type Copy linkLink copied to clipboard!
When using one of the IDoc Camel SAP endpoints, the type of the message body depends on which particular endpoint you are using.
For a sap-idoc-destination endpoint or a sap-qidoc-destination endpoint, the message body is of Document type:
org.fusesource.camel.component.sap.model.idoc.Document
org.fusesource.camel.component.sap.model.idoc.Document
For a sap-idoclist-destination endpoint, a sap-qidoclist-destination endpoint, or a sap-idoclist-server endpoint, the message body is of DocumentList type:
org.fusesource.camel.component.sap.model.idoc.DocumentList
org.fusesource.camel.component.sap.model.idoc.DocumentList
3.88.8.2. The IDoc document model Copy linkLink copied to clipboard!
For the Camel SAP component, an IDoc document is modeled using the Eclipse Modeling Framework (EMF), which provides a wrapper API around the underlying SAP IDoc API. The most important types in this model are:
org.fusesource.camel.component.sap.model.idoc.Document org.fusesource.camel.component.sap.model.idoc.Segment
org.fusesource.camel.component.sap.model.idoc.Document
org.fusesource.camel.component.sap.model.idoc.Segment
The Document type represents an IDoc document instance. In outline, the Document interface exposes the following methods:
The following kinds of method are exposed by the Document interface:
- Methods for accessing the control record
- Most of the methods are for accessing or modifying field values of the IDoc control record. These methods are of the form AttributeName, where AttributeName is the name of a field value.
- Method for accessing the document contents
The
getRootSegmentmethod provides access to the document contents (IDoc data records), returning the contents as aSegmentobject. EachSegmentobject can contain an arbitrary number of child segments, and the segments can be nested to an arbitrary degree.Note, however, that the precise layout of the segment hierarchy is defined by the particular IDoc type of the document. When creating (or reading) a segment hierarchy, therefore, you must be sure to follow the exact structure as defined by the IDoc type.
The Segment type is used to access the data records of the IDoc document, where the segments are laid out in accordance with the structure defined by the document’s IDoc type. In outline, the Segment interface exposes the following methods:
The getChildren(String segmentType) method is particularly useful for adding new (nested) children to a segment. It returns an object of type, SegmentList, which is defined as follows:
Hence, to create a data record of E1SCU_CRE type, you could use Java code like the following:
Segment rootSegment = document.getRootSegment();
Segment E1SCU_CRE_Segment = rootSegment.getChildren("E1SCU_CRE").add();
Segment rootSegment = document.getRootSegment();
Segment E1SCU_CRE_Segment = rootSegment.getChildren("E1SCU_CRE").add();
3.88.9. Document attributes Copy linkLink copied to clipboard!
IDoc Document Attributes table shows the control record attributes that you can set on the Document object.
| Attribute | Length | SAP Field | Description |
|---|---|---|---|
|
| 70 |
| EDI archive key |
|
| 3 |
| Client |
|
| 8 |
| Date IDoc was created |
|
| 6 |
| Time IDoc was created |
|
| 1 |
| Direction |
|
| 14 |
| Reference to message |
|
| 14 |
| Reference to message group |
|
| 6 |
| EDI message type |
|
| 1 |
| EDI standard |
|
| 6 |
| Version of EDI standard |
|
| 14 |
| Reference to interchange file |
|
| 8 |
| IDoc type |
|
| 16 |
| IDoc number |
|
| 4 |
| SAP Release of IDoc |
|
| 30 |
| Name of basic IDoc type |
|
| 30 |
| Name of extension type |
|
| 3 |
| Logical message code |
|
| 3 |
| Logical message function |
|
| 30 |
| Logical message type |
|
| 1 |
| Output mode |
|
| 10 |
| Receiver address (SADR) |
|
| 70 |
| Logical address of receiver |
|
| 2 |
| Partner function of receiver |
|
| 10 |
| Partner number of receiver |
|
| 2 |
| Partner type of receiver |
|
| 10 |
| Receiver port (SAP System, EDI subsystem) |
|
|
| Sender address (SADR) | |
|
| 70 |
| Logical address of sender |
|
| 2 |
| Partner function of sender |
|
| 10 |
| Partner number of sender |
|
| 2 |
| Partner type of sender |
|
| 10 |
| Sender port (SAP System, EDI subsystem) |
|
| 20 |
| EDI/ALE: Serialization field |
|
| 2 |
| Status of IDoc |
|
| 1 |
| Test flag |
3.88.9.1. Setting document attributes in Java Copy linkLink copied to clipboard!
When setting the control record attributes in Java, the usual convention for Java bean properties is followed. That is, a name attribute can be accessed through the getName and setName methods, for getting and setting the attribute value. For example, the iDocType, iDocTypeExtension, and messageType attributes can be set as follows on a Document object:
// Java
document.setIDocType("FLCUSTOMER_CREATEFROMDATA01");
document.setIDocTypeExtension("");
document.setMessageType("FLCUSTOMER_CREATEFROMDATA");
// Java
document.setIDocType("FLCUSTOMER_CREATEFROMDATA01");
document.setIDocTypeExtension("");
document.setMessageType("FLCUSTOMER_CREATEFROMDATA");
3.88.9.2. Setting document attributes in XML Copy linkLink copied to clipboard!
When setting the control record attributes in XML, the attributes must be set on the idoc:Document element. For example, the iDocType, iDocTypeExtension, and messageType attributes can be set as follows:
3.88.10. Transaction Support Copy linkLink copied to clipboard!
3.88.10.1. BAPI transaction model Copy linkLink copied to clipboard!
The SAP Component supports the BAPI transaction model for outbound communication with SAP. A destination endpoint with a URL containing the transacted option set to true will, if necessary, initiate a stateful session on the outbound connection of the endpoint and register a Camel Synchronization object with the exchange. This synchronization object will call the BAPI service method BAPI_TRANSACTION_COMMIT and end the stateful session when the processing of the message exchange is complete. If the processing of the message exchange fails, the synchronization object will call the BAPI server method BAPI_TRANSACTION_ROLLBACK and end the stateful session.
3.88.10.2. RFC transaction model Copy linkLink copied to clipboard!
The tRFC protocol accomplishes an AT-MOST-ONCE delivery and processing guarantee by identifying each transactional request with a unique transaction identifier (TID). A TID accompanies each request sent in the protocol. A sending application using the tRFC protocol must identify each instance of a request with a unique TID when sending the request. An application may send a request with a given TID multiple times, but the protocol ensures that the request is delivered and processed in the receiving system at most once. An application may choose to resend a request with a given TID when encountering a communication or system error when sending the request, and is thus in doubt whether that request was delivered and processed in the receiving system. By resending a request when encountering a communication error, a client application using the tRFC protocol can thus ensure EXACTLY-ONCE delivery and processing guarantees for its request.
3.88.10.3. Which transaction model to use? Copy linkLink copied to clipboard!
A BAPI transaction is an application level transaction, in the sense that it imposes ACID guarantees on the persistent data changes performed by a BAPI method or RFC function in the SAP database. An RFC transaction is a communication transaction, in the sense that it imposes delivery guarantees (AT-MOST-ONCE, EXACTLY-ONCE, EXACTLY-ONCE-IN-ORDER) on requests to a BAPI method and/or RFC function.
3.88.10.4. Transactional RFC destination endpoints Copy linkLink copied to clipboard!
The following destination endpoints support RFC transactions:
-
sap-trfc-destination -
sap-qrfc-destination
A single Camel route can include multiple transactional RFC destination endpoints, sending messages to multiple RFC destinations and even sending messages to the same RFC destination multiple times. This implies that the Camel SAP component potentially needs to keep track of many transaction IDs (TIDs) for each Exchange object passing along a route. Now if the route processing fails and must be retried, the situation gets quite complicated. The RFC transaction semantics demand that each RFC destination along the route must be invoked using the same TID that was used the first time around (and where the TIDs for each destination are distinct from each other). In other words, the Camel SAP component must keep track of which TID was used at which point along the route, and remember this information, so that the TIDs can be replayed in the correct order.
By default, Camel does not provide a mechanism that enables an Exchange to know where it is in a route. To provide such a mechanism, it is necessary to install the CurrentProcessorDefinitionInterceptStrategy interceptor into the Camel runtime. This interceptor must be installed into the Camel runtime, in order for the Camel SAP component to keep track of the TIDs in a route.
3.88.10.5. Transactional RFC server endpoints Copy linkLink copied to clipboard!
The following server endpoints support RFC transactions:
-
sap-trfc-server
When a Camel exchange processing a transactional request encounters a processing error, Camel handles the processing error through its standard error handling mechanisms. If the Camel route processing the exchange is configured to propagate the error back to the caller, the SAP server endpoint that initiated the exchange takes note of the failure and the sending SAP system is notified of the error. The sending SAP system can then respond by sending another transaction request with the same TID to process the request again.
3.88.11. XML Serialization for RFC Copy linkLink copied to clipboard!
SAP request and response objects support an XML serialization format which enable these objects to be serialized to and from an XML document.
3.88.11.1. XML namespace Copy linkLink copied to clipboard!
Each RFC in a repository defines a specific XML namespace for the elements which compose the serialized forms of its Request and Response objects. The form of this namespace URL is as follows:
http://sap.fusesource.org/rfc>/<Repository Name>/<RFC Name>
http://sap.fusesource.org/rfc>/<Repository Name>/<RFC Name>
RFC namespace URLs have a common http://sap.fusesource.org/rfc prefix followed by the name of the repository in which the RFC’s metadata is defined. The final component in the URL is the name of the RFC itself.
3.88.11.2. Request and response XML documents Copy linkLink copied to clipboard!
An SAP request object will be serialized into an XML document with the root element of that document named Request and scoped by the namespace of the request’s RFC.
<?xml version="1.0" encoding="ASCII"?>
<BOOK_FLIGHT:Request
xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
...
</BOOK_FLIGHT:Request>
<?xml version="1.0" encoding="ASCII"?>
<BOOK_FLIGHT:Request
xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
...
</BOOK_FLIGHT:Request>
An SAP response object will be serialized into an XML document with the root element of that document named Response and scoped by the namespace of the response’s RFC.
<?xml version="1.0" encoding="ASCII"?>
<BOOK_FLIGHT:Response
xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
...
</BOOK_FLIGHT:Response>
<?xml version="1.0" encoding="ASCII"?>
<BOOK_FLIGHT:Response
xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
...
</BOOK_FLIGHT:Response>
3.88.11.3. Structure fields Copy linkLink copied to clipboard!
Structure fields in parameter lists or nested structures are serialized as elements. The element name of the serialized structure corresponds to the field name of the structure within the enclosing parameter list, structure or table row entry it resides.
<BOOK_FLIGHT:FLTINFO
xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
...
</BOOK_FLIGHT:FLTINFO>
<BOOK_FLIGHT:FLTINFO
xmlns:BOOK_FLIGHT="http://sap.fusesource.org/rfc/nplServer/BOOK_FLIGHT">
...
</BOOK_FLIGHT:FLTINFO>
Note that the type name of the structure element in the RFC namespace will correspond to the name of the record metadata object which defines the structure, as in the following example:
This distinction will be important when specifying a JAXB bean to marshal and unmarshal the structure.
3.88.11.4. Table fields Copy linkLink copied to clipboard!
Table fields in parameter lists or nested structures are serialized as elements. The element name of the serialized structure will correspond to the field name of the table within the enclosing parameter list, structure, or table row entry it resides. The table element will contain a series of row elements to hold the serialized values of the table’s row entries.
Note that the type name of the table element in the RFC namespace corresponds to the name of the record metadata object which defines the row structure of the table suffixed by _TABLE. The type name of the table row element in the RFC name corresponds to the name of the record metadata object which defines the row structure of the table, as in the following example:
This distinction will be important when specifying a JAXB bean to marshal and unmarshal the structure.
3.88.11.5. Elementary fields Copy linkLink copied to clipboard!
Elementary fields in parameter lists or nested structures are serialized as attributes on the element of the enclosing parameter list or structure. The attribute name of the serialized field corresponds to the field name of the field within the enclosing parameter list, structure, or table row entry it resides, as in the following example:
3.88.11.6. Date and time formats Copy linkLink copied to clipboard!
Date and Time fields are serialized into attribute values using the following format:
yyyy-MM-dd'T'HH:mm:ss.SSSZ
yyyy-MM-dd'T'HH:mm:ss.SSSZ
Date fields will be serialized with only the year, month, day and timezone components set:
DEPDATE="2014-03-19T00:00:00.000-0400"
DEPDATE="2014-03-19T00:00:00.000-0400"
Time fields will be serialized with only the hour, minute, second, millisecond and timezone components set:
DEPTIME="1970-01-01T16:00:00.000-0500"
DEPTIME="1970-01-01T16:00:00.000-0500"
3.88.12. XML Serialization for IDoc Copy linkLink copied to clipboard!
An IDoc message body can be serialized into an XML string format, with the help of a built-in type converter.
3.88.12.1. XML namespace Copy linkLink copied to clipboard!
Each serialized IDoc is associated with an XML namespace, which has the following general format:
http://sap.fusesource.org/idoc/repositoryName/idocType/idocTypeExtension/systemRelease/applicationRelease
http://sap.fusesource.org/idoc/repositoryName/idocType/idocTypeExtension/systemRelease/applicationRelease
Both the repositoryName (name of the remote SAP metadata repository) and the idocType (IDoc document type) are mandatory, but the other components of the namespace can be left blank. For example, you could have an XML namespace like the following:
http://sap.fusesource.org/idoc/MY_REPO/FLCUSTOMER_CREATEFROMDATA01///
http://sap.fusesource.org/idoc/MY_REPO/FLCUSTOMER_CREATEFROMDATA01///
3.88.12.2. Built-in type converter Copy linkLink copied to clipboard!
The Camel SAP component has a built-in type converter, which is capable of converting a Document object or a DocumentList object to and from a String type.
For example, to serialize a Document object to an XML string, you can simply add the following line to a route in XML DSL:
<convertBodyTo type="java.lang.String">;
<convertBodyTo type="java.lang.String">;
You can also use this approach to a serialized XML message into a Document object. For example, given that the current message body is a serialized XML string, you can convert it back into a Document object by adding the following line to a route in XML DSL:
<convertBodyTo type="org.fusesource.camel.component.sap.model.idoc.Document">
<convertBodyTo type="org.fusesource.camel.component.sap.model.idoc.Document">
3.88.12.3. Sample IDoc message body in XML format Copy linkLink copied to clipboard!
When you convert an IDoc message to a String, it is serialized into an XML document, where the root element is either idoc:Document (for a single document) or idoc:DocumentList (for a list of documents). It shows that a single IDoc document that has been serialized to an idoc:Document element.
Example 3.2. IDoc Message Body in XML
3.88.13. Example 1: Reading Data from SAP Copy linkLink copied to clipboard!
This example demonstrates a route that reads FlightCustomer business object data from SAP. The route invokes the FlightCustomer BAPI method, BAPI_FLCUST_GETLIST, using an SAP synchronous RFC destination endpoint to retrieve the data.
3.88.13.1. Java DSL for route Copy linkLink copied to clipboard!
The Java DSL for the example route is as follows:
from("direct:getFlightCustomerInfo")
.to("bean:createFlightCustomerGetListRequest")
.to("sap-srfc-destination:nplDest:BAPI_FLCUST_GETLIST")
.to("bean:returnFlightCustomerInfo");
from("direct:getFlightCustomerInfo")
.to("bean:createFlightCustomerGetListRequest")
.to("sap-srfc-destination:nplDest:BAPI_FLCUST_GETLIST")
.to("bean:returnFlightCustomerInfo");
3.88.13.2. XML DSL for route Copy linkLink copied to clipboard!
And the Spring DSL for the same route is as follows:
3.88.13.3. createFlightCustomerGetListRequest bean Copy linkLink copied to clipboard!
The createFlightCustomerGetListRequest bean is responsible for building an SAP request object in its exchange method that is used in the RFC call of the subsequent SAP endpoint. The following code snippet demonstrates the sequence of operations to build the request object:
3.88.13.4. returnFlightCustomerInfo bean Copy linkLink copied to clipboard!
The returnFlightCustomerInfo bean is responsible for extracting data from the SAP response object in its exchange method that it receives from the previous SAP endpoint. The following code snippet demonstrates the sequence of operations to extract the data from the response object:
3.88.14. Example 2: Writing Data to SAP Copy linkLink copied to clipboard!
This example demonstrates a route that creates a FlightTrip business object instance in SAP. The route invokes the FlightTrip BAPI method, BAPI_FLTRIP_CREATE, using a destination endpoint to create the object.
3.88.14.1. Java DSL for route Copy linkLink copied to clipboard!
The Java DSL for the example route is as follows:
from("direct:createFlightTrip")
.to("bean:createFlightTripRequest")
.to("sap-srfc-destination:nplDest:BAPI_FLTRIP_CREATE?transacted=true")
.to("bean:returnFlightTripResponse");
from("direct:createFlightTrip")
.to("bean:createFlightTripRequest")
.to("sap-srfc-destination:nplDest:BAPI_FLTRIP_CREATE?transacted=true")
.to("bean:returnFlightTripResponse");
3.88.14.2. XML DSL for route Copy linkLink copied to clipboard!
And the Spring DSL for the same route is as follows:
3.88.14.3. Transaction support Copy linkLink copied to clipboard!
Note that the URL for the SAP endpoint has the transacted option set to true. When this option is enabled, the endpoint ensures that an SAP transaction session has been initiated before invoking the RFC call. Because this endpoint’s RFC creates new data in SAP, this option is necessary to make the route’s changes permanent in SAP.
3.88.14.4. Populating request parameters Copy linkLink copied to clipboard!
The createFlightTripRequest and returnFlightTripResponse beans are responsible for populating request parameters into the SAP request and extracting response parameters from the SAP response respectively, following the same sequence of operations as demonstrated in the previous example.
3.88.15. Example 3: Handling Requests from SAP Copy linkLink copied to clipboard!
This example demonstrates a route which handles a request from SAP to the BOOK_FLIGHT RFC, which is implemented by the route. In addition, it demonstrates the component’s XML serialization support, using JAXB to unmarshal and marshal SAP request objects and response objects to custom beans.
This route creates a FlightTrip business object on behalf of a travel agent, FlightCustomer. The route first unmarshals the SAP request object received by the SAP server endpoint into a custom JAXB bean. This custom bean is then multicasted in the exchange to three sub-routes, which gather the travel agent, flight connection, and passenger information required to create the flight trip. The final sub-route creates the flight trip object in SAP, as demonstrated in the previous example. The final sub-route also creates and returns a custom JAXB bean which is marshaled into an SAP response object and returned by the server endpoint.
3.88.15.1. Java DSL for route Copy linkLink copied to clipboard!
The Java DSL for the example route is as follows:
3.88.15.2. XML DSL for route Copy linkLink copied to clipboard!
And the XML DSL for the same route is as follows:
3.88.15.3. BookFlightRequest bean Copy linkLink copied to clipboard!
The following listing illustrates a JAXB bean which unmarshals from the serialized form of an SAP BOOK_FLIGHT request object:
3.88.15.4. BookFlightResponse bean Copy linkLink copied to clipboard!
The following listing illustrates a JAXB bean which marshals to the serialized form of an SAP BOOK_FLIGHT response object:
The complex parameter fields of the response object are serialized as child elements of the response.
3.88.15.5. FlightInfo bean Copy linkLink copied to clipboard!
The following listing illustrates a JAXB bean which marshals to the serialized form of the complex structure parameter FLTINFO:
3.88.15.6. ConnectionInfoTable bean Copy linkLink copied to clipboard!
The following listing illustrates a JAXB bean which marshals to the serialized form of the complex table parameter, CONNINFO. Note that the name of the root element type of the JAXB bean corresponds to the name of the row structure type suffixed with _TABLE and the bean contains a list of row elements.
3.88.15.7. ConnectionInfo bean Copy linkLink copied to clipboard!
The following listing illustrates a JAXB bean, which marshals to the serialized form of the above tables row elements:
3.89. XQuery Copy linkLink copied to clipboard!
Query and/or transform XML payloads using XQuery and Saxon.
3.89.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.
3.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-saxon</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-saxon</artifactId>
</dependency>
3.89.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
3.90. Scheduler Copy linkLink copied to clipboard!
Generate messages in specified intervals using java.util.concurrent.ScheduledExecutorService.
3.90.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.
3.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-scheduler</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-scheduler</artifactId>
</dependency>
3.91. SEDA Copy linkLink copied to clipboard!
Asynchronously call another endpoint from any Camel Context in the same JVM.
3.91.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.
3.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-seda</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-seda</artifactId>
</dependency>
3.92. Servlet Copy linkLink copied to clipboard!
Serve HTTP requests by a Servlet.
3.92.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.
3.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-servlet</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-servlet</artifactId>
</dependency>
3.92.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)
3.92.4. 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: |
| |
|
A fully qualified name of a servlet class to serve paths that match |
|
|
|
A servletName as it would be defined in a |
|
|
|
A comma separated list of path patterns under which the CamelServlet should be accessible. Example path patterns: |
| |
|
A fully qualified name of a servlet class to serve paths that match |
|
|
|
A servletName as it would be defined in a |
|
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
3.93. Slack Copy linkLink copied to clipboard!
Send and receive messages to/from Slack.
3.93.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.
3.93.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>
3.93.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.
3.94. SNMP Copy linkLink copied to clipboard!
Receive traps and poll SNMP (Simple Network Management Protocol) capable devices.
3.94.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.
3.94.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>
3.95. SOAP dataformat Copy linkLink copied to clipboard!
Marshal Java objects to SOAP messages and back.
3.95.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-soap</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-soap</artifactId>
</dependency>
3.96. Splunk Copy linkLink copied to clipboard!
Publish or search for events in Splunk.
3.96.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.
3.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-splunk</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-splunk</artifactId>
</dependency>
3.96.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.
3.97. Splunk HEC Copy linkLink copied to clipboard!
The splunk component allows to publish events in Splunk using the HTTP Event Collector.
3.97.1. What’s inside Copy linkLink copied to clipboard!
-
Splunk HEC component, URI syntax:
splunk-hec:splunkURL/token
Refer to the above link for usage and configuration details.
3.97.2. Maven coordinates Copy linkLink copied to clipboard!
<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>
3.98. SQL Copy linkLink copied to clipboard!
Perform SQL queries.
3.98.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.
3.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-sql</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-sql</artifactId>
</dependency>
3.98.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.98.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.
3.98.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.
3.98.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
3.98.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).
3.99. Telegram Copy linkLink copied to clipboard!
Send and receive messages acting as a Telegram Bot Telegram Bot API.
3.99.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.
3.99.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>
3.99.3. Usage Copy linkLink copied to clipboard!
3.99.4. Webhook Mode Copy linkLink copied to clipboard!
The Telegram extension supports usage in the webhook mode.
In order to enable webhook mode, you must add a REST implementation to your application. Maven users, for example, can add the 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>
3.99.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.
3.99.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.
3.100. Timer Copy linkLink copied to clipboard!
Generate messages in specified intervals using java.util.Timer.
3.100.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.
3.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-timer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-timer</artifactId>
</dependency>
3.101. Validator Copy linkLink copied to clipboard!
Validate the payload using XML Schema and JAXP Validation.
3.101.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.
3.101.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>
3.102. Velocity Copy linkLink copied to clipboard!
Transform messages using a Velocity template.
3.102.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.
3.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-velocity</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-velocity</artifactId>
</dependency>
3.102.3. Usage Copy linkLink copied to clipboard!
3.102.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 {
}
3.102.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.
3.102.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
3.103. Vert.x HTTP Client Copy linkLink copied to clipboard!
Camel HTTP client support with Vert.x
3.103.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.
3.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-vertx-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-vertx-http</artifactId>
</dependency>
3.103.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)
3.103.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.103.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.
3.103.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.
3.104. 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.
3.104.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.
3.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-vertx-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-vertx-websocket</artifactId>
</dependency>
3.104.3. Usage Copy linkLink copied to clipboard!
3.104.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.
3.104.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).
3.104.4. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.104.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.
3.104.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.
3.105. XJ Copy linkLink copied to clipboard!
Transform JSON and XML message using a XSLT.
3.105.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.
3.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-xj</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xj</artifactId>
</dependency>
3.106. XML IO DSL Copy linkLink copied to clipboard!
An XML stack for parsing XML route definitions
3.106.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-xml-io-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-io-dsl</artifactId>
</dependency>
3.106.3. Additional Camel Quarkus configuration Copy linkLink copied to clipboard!
3.106.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.
3.107. XML JAXP Copy linkLink copied to clipboard!
XML JAXP type converters and parsers
3.107.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>
3.108. XPath Copy linkLink copied to clipboard!
Evaluates an XPath expression against an XML payload
3.108.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-xpath</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xpath</artifactId>
</dependency>
3.108.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
3.109. XSLT Saxon Copy linkLink copied to clipboard!
Transform XML payloads using an XSLT template using Saxon.
3.109.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.
3.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-xslt-saxon</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xslt-saxon</artifactId>
</dependency>
3.110. XSLT Copy linkLink copied to clipboard!
Transforms XML payload using an XSLT template.
3.110.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.
3.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-xslt</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xslt</artifactId>
</dependency>
3.110.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.
3.110.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
3.110.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. |
| |
|
The package name for the generated classes. |
|
|
|
TransformerFactory features. |
|
Configuration property fixed at build time. All other configuration properties are overridable at runtime.
3.111. YAML DSL Copy linkLink copied to clipboard!
An YAML stack for parsing YAML route definitions
3.111.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-yaml-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-yaml-dsl</artifactId>
</dependency>
3.111.3. Usage Copy linkLink copied to clipboard!
3.111.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.
3.111.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 {
}
3.111.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 {
}
3.112. 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.
3.112.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above links for usage and configuration details.
3.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-zip-deflater</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-zip-deflater</artifactId>
</dependency>
3.113. Zip File Copy linkLink copied to clipboard!
Compression and decompress streams using java.util.zip.ZipStream.
3.113.1. What’s inside Copy linkLink copied to clipboard!
Refer to the above link for usage and configuration details.
3.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-zipfile</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-zipfile</artifactId>
</dependency>
Chapter 4. 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.
4.1. Quarkus CXF Copy linkLink copied to clipboard!
Here is the list of extensions produced by this project. Please follow the links under the extension names to learn about how to use them, about their configuration 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 |
4.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.
4.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.
4.2.2. Data Bindings Copy linkLink copied to clipboard!
Out of CXF Data Bindings only the following ones are supported:
4.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
4.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
4.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 |
4.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 |
4.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 5. Quarkus CXF extensions reference Copy linkLink copied to clipboard!
This chapter provides reference information about Quarkus CXF extensions.
5.1. Quarkus CXF Copy linkLink copied to clipboard!
Core capabilities for implementing SOAP clients and JAX-WS services.
5.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>
5.1.2. Supported standards Copy linkLink copied to clipboard!
5.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
- Common problems and troubleshooting
5.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: | ||
5.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.
5.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>
5.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.
5.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:
5.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: | ||
|
|
| |
|
If
Environment variable: | ||
|
|
| |
|
If
Environment variable: | ||
5.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. Therefore, tracing is the only OpenTelemetry feature supported by this extension.
5.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>
5.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.
5.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.
5.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: | ||
5.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
5.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>
5.4.2. Supported standards Copy linkLink copied to clipboard!
5.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.
5.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 {link-quarkus-cxf-source-tree-base}/integration-tests/ws-security-policy/src/main/resources/encrypt-sign-policy.xml[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) {link-quarkus-cxf-source-tree-base}/integration-tests/ws-security-policy/src/main/java/io/quarkiverse/cxf/it/security/policy/EncryptSignPolicyHelloService.java#L11[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.
5.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: | ||
5.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.
5.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>
5.5.2. Supported standards Copy linkLink copied to clipboard!
5.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:
5.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 {link-quarkus-cxf-source-tree-base}/integration-tests/ws-rm-client/src/test/java/io/quarkiverse/cxf/it/ws/rm/client/WsReliableMessagingTest.java#L28[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.
5.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: | ||
5.6. Security Token Service (STS) Copy linkLink copied to clipboard!
Issue, renew and validate security tokens in context of WS-Trust.
5.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>
5.6.2. Supported standards Copy linkLink copied to clipboard!
5.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.
5.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.
5.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
5.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
5.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
5.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 the quarkus-cxf-rt-ws-security 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
5.7. HTTP Async Transport Copy linkLink copied to clipboard!
Implement async SOAP Clients using Apache HttpComponents HttpClient 5.
5.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>
5.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.
5.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
5.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:
5.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.
5.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.
5.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 6. Quarkus CXF user guide Copy linkLink copied to clipboard!
This chapter provides information about Quarkus CXF usage and configuration.
6.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:
6.2. 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.
6.2.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.
6.2.2. Create 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.
6.2.3. Dependency management Copy linkLink copied to clipboard!
Quarkus CXF is a part of Quarkus Platform since Quarkus Platform version 3.1.0.Final. Among other things, this means that code.quarkus.redhat.com and other Quarkus development tools generate projects with proper dependency management:
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.
6.2.4. Where to go next Copy linkLink copied to clipboard!
We recommend to proceed with any of the following chapters:
- Your first SOAP Web service
- ug_first-soap-client[Your first SOAP Client]
6.3. 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.
6.3.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.
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.
6.3.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:
6.3.3. Further steps Copy linkLink copied to clipboard!
You may want to proceed with packaging your application for running on a JVM or natively.
6.4. 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.
6.4.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:
6.4.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.
6.4.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.
6.4.4. Further steps Copy linkLink copied to clipboard!
You may want to proceed with
6.5. 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.
6.5.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.
6.5.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.
6.5.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:
6.6. 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.
6.6.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.
6.6.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 6.2.2, “Create 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!
6.6.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.
6.6.4. Create container image Copy linkLink copied to clipboard!
Refer to Quarkus Container image guide.
6.7. 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
6.7.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.
6.7.2. Configuring payload logging through configuration properties Copy linkLink copied to clipboard!
6.7.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).
6.7.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:
6.7.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
6.7.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
6.8. Complex SOAP payloads with JAXB Copy linkLink copied to clipboard!
Our introductory guides for Quarkus ug_first-soap-client[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.
6.8.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.
6.8.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:
6.8.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
6.8.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.
6.8.5. Further steps Copy linkLink copied to clipboard!
You may want to proceed with packaging your application for running on a JVM or natively.
6.9. SSL, TLS and HTTPS Copy linkLink copied to clipboard!
This chapter 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.9.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 for creating and maintaining truststores.
We have examples for both tools in Quarkus CXF source tree:
- {link-quarkus-cxf-source-tree-base}/integration-tests/ws-security-policy/pom.xml#L127-L440[Create truststore with Java 'keytool' (wrapped by a Maven plugin)]
-
{link-quarkus-cxf-source-tree-base}/integration-tests/ws-security-policy/generate-certs.sh[Create truststore with
openssl]
Once you have prepared the trust store, you need to configure your client to use it.
6.9.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
6.9.2. Server SSL configuration Copy linkLink copied to clipboard!
To make your services available over the HTTPS protocol, you need to setup 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
quarkus.http.ssl.certificate.key-store-file = localhost-keystore.${keystore.type}
quarkus.http.ssl.certificate.key-store-password = localhost-keystore-password
quarkus.http.ssl.certificate.key-store-key-alias = localhost
quarkus.http.ssl.certificate.key-store-key-password = localhost-keystore-password
quarkus.http.ssl.certificate.key-store-file = localhost-keystore.${keystore.type}
quarkus.http.ssl.certificate.key-store-password = localhost-keystore-password
quarkus.http.ssl.certificate.key-store-key-alias = localhost
quarkus.http.ssl.certificate.key-store-key-password = localhost-keystore-password
- 1
- The referenced
localhost.jksfile has to be available insrc/main/resourcesdirectory.
6.9.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 setup 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 {link-quarkus-cxf-source-tree-base}/integration-tests/mtls/generate-certs.sh[openssl] (or alternatively with Java {link-quarkus-cxf-source-tree-base}/integration-tests/mtls/pom.xml#L109-L377[Java keytool])
Here is the application.properties file:
application.properties
6.9.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.10. 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.10.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.10.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.10.2. Mutual TLS (mTLS) authentication Copy linkLink copied to clipboard!
See the Mutual TLS (mTLS) authentication section in SSL, TLS and HTTPS guide.
6.10.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.11. Advanced SOAP client topics Copy linkLink copied to clipboard!
6.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.
6.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
6.11.3. Advanced Client Configurations Copy linkLink copied to clipboard!
To globally configure all clients in your application, you can use the example snippet below to configure the HttpConduit. This allows you to set the HTTPClientPolicy, AuthorizationPolicy, ProxyAuthorizationPolicy or even TLSClientParameters for your clients.
6.11.4. 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
6.11.5. 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():
6.12. 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"/>
...
6.13. 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.
6.13.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.
6.13.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.
6.13.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.
6.14. 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.
6.15. 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.HelloService,io.quarkiverse.cxf.it.server.FaultyHelloService quarkus.cxf.java2ws.wsdl-name-template = %TARGET_DIR%/Java2wsTest/%SIMPLE_CLASS_NAME%-from-java2ws.wsdl
quarkus.cxf.java2ws.includes = io.quarkiverse.cxf.it.server.HelloService,io.quarkiverse.cxf.it.server.FaultyHelloService
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 interfaces, namely HelloService and FaultyHelloService.
Note that the Service interfaces 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/FaultyHelloService-from-java2ws.wsdl and target/Java2wsTest/HelloService-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.
6.15.1. See also Copy linkLink copied to clipboard!
-
quarkus.cxf.java2ws.*configuration properties ofquarkus-cxf
6.16. 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.
6.17. 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.
6.18. 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.
6.19. Examples Copy linkLink copied to clipboard!
The integration-tests folder of the codebase provides various examples that demonstrate how to use this extension extensively.
6.20. Common problems and troubleshooting Copy linkLink copied to clipboard!
Some issues may appear during the development, testing, and native image building process of your quarkus-cxf project; below are some common ones and how to address them.
6.20.1. 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
6.20.2. 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:
6.21. Camel Integration Copy linkLink copied to clipboard!
https//camel.apache.org/camel-quarkus/latest/index.html[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.
Please refer to https//camel.apache.org/camel-quarkus/latest/reference/extensions/cxf-soap.html[Camel Quarkus CXF SOAP] extension documentation for further details.
Chapter 7. Camel Quarkus transaction guide Copy linkLink copied to clipboard!
7.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.
7.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.
7.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 |
7.3. Configuring transactional resources Copy linkLink copied to clipboard!
7.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.
7.3.2. JMS Configuration Copy linkLink copied to clipboard!
In order to use JMS with distributed transactions, you must do the 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.
7.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.
7.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.
7.6. Known issues Copy linkLink copied to clipboard!
7.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