Red Hat build of Apache Camel for Quarkus Reference


Red Hat build of Apache Camel 4.8

Red Hat build of Apache Camel for Quarkus provided by Red Hat

Abstract

Red Hat build of Apache Camel for Quarkus provides Quarkus extensions for many of the Camel components. This reference describes the settings for each of the extensions supported by Red Hat.

Preface

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

  1. Click the following link to create ticket
  2. Enter a brief description of the issue in the Summary.
  3. Provide a detailed description of the issue or enhancement in the Description. Include a URL to where the issue occurs in the documentation.
  4. Clicking Submit creates and routes the issue to the appropriate documentation team.

Chapter 1. Camel Quarkus extensions overview

1.1. Support level definitions

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.

Expand
Table 1.1. Red Hat build of Apache Camel for Quarkus support levels
TypeDescription

Community Support

As part of Red Hat’s commitment to upstream first, integration of new extensions into our Red Hat build of Apache Camel for Quarkus distribution begins in the upstream community. While these extensions have been tested and documented upstream, we have not reviewed the maturity of these extensions and they may not be formally supported by Red Hat in future product releases.

Note

Community extensions are listed on the extensions reference page of the Camel Quarkus community project.

Technology Preview

Technology Preview features provide early access to upcoming product innovations, enabling you to test functionality and provide feedback during the development process. However, these features are not fully supported under Red Hat Subscription Level Agreements, may not be functionally complete, and are not intended for production use. As Red Hat considers making future iterations of Technology Preview features generally available, we will attempt to resolve any issues that customers experience when using these features.

Production Support

Production Support extensions are shipped in a formal Red Hat release and are fully supported. There are no documentation gaps and extensions have been tested on all supported configurations.

1.2. Supported extensions

There are 110 extensions.

Expand
Table 1.2. Red Hat build of Apache Camel for Quarkus Support Matrix
 ExtensionArtifactDescriptionJVM Support LevelNative Support LevelSupport on IBM Power and IBM Z

1

AMQP

camel-quarkus-amqp

Messaging with AMQP protocol using Apache QPid Client.

Production Support

Production Support

Yes

2

Attachments

camel-quarkus-attachments

Support for attachments on Camel messages

Production Support

Production Support

Yes

3

AWS Secrets Manager

camel-quarkus-aws-secrets-manager

Manage AWS Secrets Manager services using AWS SDK version 2.x.

Production Support

Production Support

Yes

4

AWS2 CloudWatch

camel-quarkus-aws2-cw

Sending metrics to AWS CloudWatch using AWS SDK version 2.x.

Production Support

Production Support

Yes

5

AWS2 DynamoDB

camel-quarkus-aws2-ddb

Store and retrieve data from AWS DynamoDB service or receive messages from AWS DynamoDB Stream using AWS SDK version 2.x.

Production Support

Production Support

Yes

6

AWS2 Kinesis

camel-quarkus-aws2-kinesis

Consume and produce records from AWS Kinesis Streams using AWS SDK version 2.x.

Production Support

Production Support

Yes

7

AWS2 Lambda

camel-quarkus-aws2-lambda

Manage and invoke AWS Lambda functions using AWS SDK version 2.x.

Production Support

Production Support

Yes

8

AWS2 S3 Storage

camel-quarkus-aws2-s3

Store and retrieve objects from AWS S3 Storage Service using AWS SDK version 2.x.

Production Support

Production Support

Yes

9

AWS2 Simple Notification System (SNS)

camel-quarkus-aws2-sns

Send messages to an AWS Simple Notification Topic using AWS SDK version 2.x.

Production Support

Production Support

Yes

10

AWS2 Simple Queue Service (SQS)

camel-quarkus-aws2-sqs

Send and receive messages to/from AWS SQS service using AWS SDK version 2.x.

Production Support

Production Support

Yes

11

Azure Key Vault

camel-quarkus-azure-key-vault

Manage secrets and keys in Azure Key Vault Service

Production Support

Production Support

Yes

12

Azure ServiceBus

camel-quarkus-azure-servicebus

Send and receive messages to/from Azure Service Bus.

Technology Preview

Technology Preview

Yes

13

Azure Storage Blob

camel-quarkus-azure-storage-blob

Store and retrieve blobs from Azure Storage Blob Service using SDK v12.

Production Support

Production Support

Yes

14

Azure Storage Queue

camel-quarkus-azure-storage-queue

The azure-storage-queue component is used for storing and retrieving the messages to/from Azure Storage Queue using Azure SDK v12.

Production Support

Production Support

Yes

15

Bean

camel-quarkus-bean

Invoke methods of Java beans

Production Support

Production Support

Yes

16

BeanIO

camel-quarkus-beanio

Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats).

Production Support

Not supported

Yes

17

Bean-validator

camel-quarkus-bean-validator

Validate the message body using the Java Bean Validation API.

Production Support

Production Support

Yes

18

Browse

camel-quarkus-browse

Inspect the messages received on endpoints supporting BrowsableEndpoint.

Production Support

Production Support

Yes

19

Cassandra CQL

camel-quarkus-cassandraql

Integrate with Cassandra 2.0 using the CQL3 API (not the Thrift API). Based on Cassandra Java Driver provided by DataStax.

Production Support

Production Support

Yes

20

Cli-connector

camel-quarkus-cli-connector

Runtime adapter connecting with Camel CLI

Production Support

Production Support

Yes

21

Controlbus

camel-quarkus-controlbus

Manage and monitor Camel routes.

Production Support

Production Support

Yes

22

Core

camel-quarkus-core

Camel core functionality and basic Camel languages/ Constant, ExchangeProperty, Header, Ref, Simple and Tokenize

Production Support

Production Support

Yes

23

Crypto

camel-quarkus-crypto

Sign and verify exchanges using the Signature Service of the Java Cryptographic Extension (JCE).

Production Support

Production Support

Yes

24

Cron

camel-quarkus-cron

A generic interface for triggering events at times specified through the Unix cron syntax.

Production Support

Production Support

Yes

25

CXF SOAP

camel-quarkus-cxf-soap

Expose SOAP WebServices using Apache CXF or connect to external WebServices using CXF WS client.

Production Support

Production Support

Yes

26

Dataformat

camel-quarkus-dataformat

Use a Camel Data Format as a regular Camel Component.

Production Support

Production Support

Yes

27

Dataset

camel-quarkus-dataset

Provide data for load and soak testing of your Camel application.

Technology Preview

Technology Preview

Yes

28

Direct

camel-quarkus-direct

Call another endpoint from the same Camel Context synchronously.

Production Support

Production Support

Yes

29

Elasticsearch Low level Rest Client

camel-elasticsearch-rest-client

Perform queries and other operations on Elasticsearch or OpenSearch (uses low-level client).

Production Support

Production Support

Yes

30

FHIR

camel-quarkus-fhir

Exchange information in the healthcare domain using the FHIR (Fast Healthcare Interoperability Resources) standard. Marshall and unmarshall FHIR objects to/from JSON. Marshall and unmarshall FHIR objects to/from XML.

Production Support

Production Support

No

31

Flink

camel-quarkus-flink

Send DataSet jobs to an Apache Flink cluster.

Technology Preview

None

Yes

32

File

camel-quarkus-file

Read and write files.

Production Support

Production Support

Yes

33

File cluster service

camel-quarkus-file-cluster-service

Provides a FileLock implementation of the Camel Cluster Service SPI

Production Support

Production Support

Yes

34

FTP

camel-quarkus-ftp

Upload and download files to/from SFTP, FTP or SFTP servers

Production Support

Production Support

Yes

35

Google BigQuery

camel-quarkus-google-bigquery

Access Google Cloud BigQuery service using SQL queries or Google Client Services API

Production Support

Production Support

Yes

36

Google Pubsub

camel-quarkus-google-pubsub

Send and receive messages to/from Google Cloud Platform PubSub Service.

Production Support

Production Support

Yes

37

Google Secret Manager

camel-quarkus-google-secret-manager

Manage Google Secret Manager Secrets

Production Support

Production Support

Yes

38

GraphQL

camel-quarkus-graphql

Send GraphQL queries and mutations to external systems.

Production Support

Production Support

Yes

39

gRPC

camel-quarkus-grpc

Expose gRPC endpoints and access external gRPC endpoints.

Production Support

Production Support

Yes

40

Hashicorp Vault

camel-quarkus-hashicorp-vault

Manage secrets in Hashicorp Vault Service

Production Support

Production Support

Yes

41

HTTP

camel-quarkus-http

Send requests to external HTTP servers using Apache HTTP Client 5.x.

Production Support

Production Support

Yes

42

Infinispan

camel-quarkus-infinispan

Read and write from/to Infinispan distributed key/value store and data grid.

Production Support

Production Support

No

43

Jasypt

camel-quarkus-jasypt

Security using Jasypt

Production Support

Production Support

Yes

44

Java JOOR DSL

camel-quarkus-java-joor-dsl

Support for parsing Java route definitions at runtime

Community Support

Community Support

Yes

45

JDBC

camel-quarkus-jdbc

Access databases through SQL and JDBC.

Production Support

Production Support

Yes

46

JIRA

camel-quarkus-jira

Interact with JIRA issue tracker.

Production Support

Production Support

Yes

47

JMS

camel-quarkus-jms

Sent and receive messages to/from a JMS Queue or Topic.

Production Support

Production Support

Yes

48

JPA

camel-quarkus-jpa

Store and retrieve Java objects from databases using Java Persistence API (JPA).

Production Support

Production Support

Yes

49

JT400

camel-quarkus-jt400

Exchanges messages with an IBM i system using data queues, message queues, or program call. IBM i is the replacement for AS/400 and iSeries servers.

Production Support

Production Support

Yes

50

JTA

camel-quarkus-jta

Enclose Camel routes in transactions using Java Transaction API (JTA) and Narayana transaction manager.

Production Support

Production Support

Yes

51

Kafka

camel-quarkus-kafka

Sent and receive messages to/from an Apache Kafka broker.

Production Support

Production Support

Yes

52

Kamelet

camel-quarkus-kamelet

Materialize route templates

Production Support

Production Support

Yes

53

Kubernetes

camel-quarkus-kubernetes

Perform operations against Kubernetes API

Technology Preview

Technology Preview

Yes

54

Kubernetes Cluster Service

camel-quarkus-kubernetes-cluster-service

Provides a Kubernetes implementation of the Camel Cluster Service SPI

Production Support

Production Support

Yes

55

Kudu

camel-kudu

Interact with Apache Kudu, a free and open source column-oriented data store of the Apache Hadoop ecosystem.

Production Support

Production Support

No

56

Language

camel-quarkus-language

Execute scripts in any of the languages supported by Camel.

Production Support

Production Support

Yes

57

LDAP

camel-quarkus-ldap

Perform searches on LDAP servers.

Production Support

Production Support

Yes

58

Log

camel-quarkus-log

Log messages to the underlying logging mechanism.

Production Support

Production Support

Yes

59

LRA

camel-quarkus-lra

Camel saga binding for Long-Running-Action framework.

Technology Preview

Technology Preview

Yes

60

Mail

camel-quarkus-mail

Send and receive emails using imap, pop3 and smtp protocols. Marshal Camel messages with attachments into MIME-Multipart messages and back.

Production Support

Production Support

Yes

61

Management

camel-quarkus-management

JMX management strategy and associated managed resources.

Production Support

Production Support

Yes

62

MapStruct

camel-quarkus-mapstruct

Type Conversion using Mapstruct

Production Support

Production Support

Yes

63

Master

camel-quarkus-master

Have only a single consumer in a cluster consuming from a given endpoint; with automatic failover if the JVM dies.

Production Support

Production Support

Yes

64

Micrometer

camel-quarkus-micrometer

Collect various metrics directly from Camel routes using the Micrometer library.

Production Support

Production Support

Yes

65

MicroProfile Fault Tolerance

camel-quarkus-microprofile-fault-tolerance

Circuit Breaker EIP using Microprofile Fault Tolerance

Production Support

Production Support

Yes

66

MicroProfile Health

camel-quarkus-microprofile-health

Expose Camel health checks via MicroProfile Health

Production Support

Production Support

Yes

67

Minio

camel-quarkus-minio

Store and retrieve objects from Minio Storage Service using Minio SDK.

Production Support

Production Support

Yes

68

MLLP

camel-quarkus-mllp

Communicate with external systems using the MLLP protocol.

Production Support

Production Support

Yes

69

MyBatis

camel-quarkus-mybatis

Performs a query, poll, insert, update or delete in a relational database using MyBatis.

Production Support

Production Support

Yes

70

Mock

camel-quarkus-mock

Test routes and mediation rules using mocks.

Production Support

Production Support

Yes

71

MongoDB

camel-quarkus-mongodb

Perform operations on MongoDB documents and collections.

Technology Preview

Technology Preview

Yes

72

Netty

camel-quarkus-netty

Socket level networking using TCP or UDP with Netty 4.x.

Production Support

Production Support

Yes

73

Netty HTTP

camel-quarkus-netty-http

Netty HTTP server and client using the Netty 4.x.

Production Support

Production Support

Yes

74

Openapi Java

camel-quarkus-openapi-java

Expose OpenAPI resources defined in Camel REST DSL

Production Support

Production Support

Yes

75

OpenTelemetry

camel-quarkus-opentelemetry

Distributed tracing using OpenTelemetry

Production Support

Production Support

Yes

76

Qute

camel-quarkus-qute

Transform messages using Quarkus Qute templating engine

Production Support

Production Support

Yes

77

Quartz

camel-quarkus-quartz

Schedule sending of messages using the Quartz 2.x scheduler.

Production Support

Production Support

Yes

78

Paho

camel-quarkus-paho

Communicate with MQTT message brokers using Eclipse Paho MQTT Client.

Production Support

Production Support

Yes

79

Paho MQTT5

camel-quarkus-paho-mqtt5

Communicate with MQTT message brokers using Eclipse Paho MQTT v5 Client.

Production Support

Production Support

Yes

80

Platform HTTP

camel-quarkus-platform-http

Expose HTTP endpoints using the HTTP server available in the current platform.

Production Support

Production Support

Yes

81

Ref

camel-quarkus-ref

Route messages to an endpoint looked up dynamically by name in the Camel Registry.

Production Support

Production Support

Yes

82

REST

camel-quarkus-rest

Expose REST services and their OpenAPI Specification or call external REST services.

Production Support

Production Support

Yes

83

REST OpenAPI

camel-quarkus-rest-openapi

Configure REST producers based on an OpenAPI specification document delegating to a component implementing the RestProducerFactory interface.

Production Support

Production Support

Yes

84

Salesforce

camel-quarkus-salesforce

Communicate with Salesforce using Java DTOs.

Production Support

Production Support

Yes

85

SAGA

camel-quarkus-saga

Execute custom actions within a route using the Saga EIP.

Technology Preview

Technology Preview

Yes

86

SAP

camel-quarkus-sap

Provides SAP Camel Component.

Production Support

None

Yes

87

Saxon

camel-quarkus-saxon

Query and/or transform XML payloads using XQuery and Saxon.

Production Support

Production Support

Yes

88

Scheduler

camel-quarkus-scheduler

Generate messages in specified intervals using java.util.concurrent.ScheduledExecutorService.

Production Support

Production Support

Yes

89

Seda

camel-quarkus-seda

Asynchronously call another endpoint from any Camel Context in the same JVM.

Production Support

Production Support

Yes

90

Servlet

camel-quarkus-servlet

Serve HTTP requests by a Servlet.

Production Support

Production Support

Yes

91

Slack

camel-quarkus-slack

Send and receive messages to/from Slack.

Production Support

Production Support

Yes

92

SMB

camel-quarkus-smb

SMB component which consumes natively from file shares using the Server Message Block (SMB, also known as Common Internet File System - CIFS) protocol

Production Support

Production Support

Yes

93

SNMP

camel-quarkus-snmp

Receive traps and poll SNMP (Simple Network Management Protocol) capable devices.

Production Support

Technology Preview

Yes

94

Splunk

camel-quarkus-splunk

Publish or search for events in Splunk.

Production Support

Production Support

Yes

95

Splunk HEC

camel-quarkus-splunk-hec

The splunk component allows to publish events in Splunk using the HTTP Event Collector.

Production Support

Production Support

Yes

96

Spring RabbitMQ

camel-quarkus-spring-rabbitmq

Send and receive messages from RabbitMQ using Spring RabbitMQ client.

Production Support

Production Support

Yes

97

SQL

camel-quarkus-sql

Perform SQL queries.

Production Support

Production Support

Yes

98

Telegram

camel-quarkus-telegram

Send and receive messages acting as a Telegram Bot Telegram Bot API.

Production Support

Production Support

Yes

99

Timer

camel-quarkus-timer

Generate messages in specified intervals using java.util.Timer.

Production Support

Production Support

Yes

100

Validator

camel-quarkus-validator

Validate the payload using XML Schema and JAXP Validation.

Production Support

Production Support

Yes

101

Velocity

camel-quarkus-velocity

Transform messages using a Velocity template.

Production Support

Production Support

Yes

102

VertX HTTP

camel-quarkus-vertx-http

Camel HTTP client support with Vert.x

Production Support

Production Support

Yes

103

VertX Websocket

camel-quarkus-vertx-websocket

Camel WebSocket support with Vert.x

Production Support

Production Support

Yes

104

XJ

camel-quarkus-xj

Transform JSON and XML message using a XSLT

Production Support

Production Support

Yes

105

XML IO DSL

camel-quarkus-xml-io-dsl

An XML stack for parsing XML route definitions

Production Support

Production Support

Yes

106

XSLT

camel-quarkus-xslt

Transforms XML payload using an XSLT template.

Production Support

Production Support

Yes

107

XSLT Saxon

camel-quarkus-xslt-saxon

Transform XML payloads using an XSLT template using Saxon.

Production Support

Production Support

Yes

108

Zip File

camel-quarkus-zipfile

Compression and decompress streams using java.util.zip.ZipStream.

Production Support

Production Support

Yes

109

Zip Deflate Compression

camel-quarkus-zip-deflater

Compress and decompress streams using java.util.zip.Deflater, java.util.zip.Inflater or java.util.zip.GZIPStream.

Production Support

Production Support

Yes

1.3. Supported languages

There are 11 languages.

Expand
Table 1.3. Red Hat build of Apache Camel for Quarkus Support matrix languages
 ExtensionArtifactDescriptionJVM Support LevelNative Support LevelSupport on IBM Power and IBM Z

1

Bean

camel-quarkus-bean

Invoke methods of Java beans.

Production Support

Production Support

Yes

2

Core

camel-quarkus-core

Camel core functionality and basic Camel languages/ Constant, ExchangeProperty, Header, Ref, Simple and Tokenize.

Production Support

Production Support

Yes

3

Hl7

camel-quarkus-hl7

Marshal and unmarshal HL7 (Health Care) model objects using the HL7 MLLP codec.

Production Support

Production Support

Yes

4

JSONPath

camel-quarkus-jsonpath

Evaluate a JSONPath expression against a JSON message body.

Production Support

Production Support

Yes

5

Jslt

camel-quarkus-jslt

Query or transform JSON payloads using an JSLT.

Production Support

Production Support

Yes

110

JQ

camel-quarkus-jq

Evaluates a JQ expression against a JSON message body.

Production Support

Production Support

Yes

6

Saxon

camel-quarkus-saxon

Query and/or transform XML payloads using XQuery and Saxon.

Production Support

Production Support

Yes

7

XML IO DSL

camel-quarkus-xml-io-dsl

An XML stack for parsing XML route definitions

Production Support

Production Support

Yes

8

XML IO DSL

camel-quarkus-xml-io-dsl

An XML stack for parsing XML route definitions

Production Support

Production Support

Yes

9

Xpath

camel-quarkus-xpath

Evaluates an XPath expression against an XML payload.

Production Support

Production Support

Yes

10

YAML DSL

camel-quarkus-yaml-dsl

A YAML stack for parsing YAML route definitions

Production Support

Production Support

Yes

11

YAML DSL

camel-quarkus-yaml-dsl

A YAML stack for parsing YAML route definitions

Production Support

Production Support

Yes

1.4. Supported data formats

There are 14 data formats.

Expand
Table 1.4. Red Hat build of Apache Camel for Quarkus Support matrix data formats
 ExtensionArtifactDescriptionJVM Support LevelNative Support LevelSupport on IBM Power and IBM Z

1

Avro

camel-quarkus-avro

Serialize and deserialize messages using Apache Avro binary data format.

Production support

Production support

Yes

2

BeanIO

camel-quarkus-beanio

Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats).

Production support

Not supported

Yes

3

Bindy

camel-quarkus-bindy

Marshal and unmarshal between POJOs on one side and Comma separated values (CSV), fixed field length or key-value pair (KVP) formats on the other side using Camel Bindy

Production support

Production support

Yes

4

Crypto

camel-quarkus-crypto

Java Cryptographic Extension: Symmetric (shared-key) encryption and decryption using Camel’s marshal and unmarshal formatting mechanism.

Production support

Production support

Yes

5

Gson

camel-quarkus-gson

Marshal POJOs to JSON and back using Gson

Production support

Production support

Yes

6

Hl7

camel-quarkus-hl7

Marshal and unmarshal HL7 (Health Care) model objects using the HL7 MLLP codec.

Production support

Production support

Yes

7

Jackson

camel-quarkus-jackson

Marshal POJOs to JSON and back using Jackson

Production support

Production support

Yes

8

Jackson Avro

camel-quarkus-jackson-avro

Marshal POJOs to Avro and back using Jackson.

Production support

Production support

Yes

9

Jackson ProtoBuf

camel-quarkus-jackson-protobuf

Marshal POJOs to Protobuf and back using Jackson.

Production support

Production support

Yes

10

Jackson XML

camel-quarkus-jacksonxml

Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson.

Production support

Production support

Yes

11

Jaxb

camel-quarkus-jaxb

Unmarshal XML payloads to POJOs and back using JAXB2 XML marshalling standard.

Production support

Production support

Yes

12

Xml-JAXP

camel-quarkus-xml-jaxp

Camel XML JAXP

Production support

Production support

Yes

13

PGP

camel-quarkus-crypto

Symmetric (shared-key) encryption and decryption using Camel’s marshal and unmarshal formatting mechanism.

Production support

Production support

Yes

14

SOAP

camel-quarkus-soap

Marshal Java objects to SOAP messages and back.

Production support

Production support

Yes

Chapter 2. Camel Quarkus extensions reference

This chapter provides usage information for Red Hat build of Apache Camel for Quarkus.

2.1. AMQP

Messaging with AMQP protocol using Apache QPid Client.

2.1.1. What’s inside

Refer to the above link for usage and configuration details.

2.1.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-amqp</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.1.3. Usage

2.1.3.1. Message mapping with org.w3c.dom.Node

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.

When sending JMS message payloads as jakarta.jms.ObjectMessage, you must annotate the relevant classes to be registered for serialization with @RegisterForReflection(serialization = true). Note that this extension automatically sets quarkus.camel.native.reflection.serialization-enabled = true for you. Refer to the native mode user guide for more information.

2.1.3.3. Connection Pooling

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>
Copy to Clipboard Toggle word wrap

To enable the pooling support, you need to add the following configuration to your application.properties:

quarkus.qpid-jms.wrap=true
Copy to Clipboard Toggle word wrap

2.1.4. transferException option in native mode

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)
Copy to Clipboard Toggle word wrap

2.1.5. Additional Camel Quarkus configuration

The extension leverages the Quarkus Qpid JMS extension. A ConnectionFactory bean is automatically created and wired into the AMQP component for you. The connection factory can be configured via the Quarkus Qpid JMS configuration options.

2.2. Attachments

Support for attachments on Camel messages

2.2.1. What’s inside

Refer to the above link for usage and configuration details.

2.2.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-attachments</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.3. Avro

Serialize and deserialize messages using Apache Avro binary data format.

2.3.1. What’s inside

Refer to the above link for usage and configuration details.

2.3.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-avro</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.3.3. Additional Camel Quarkus configuration

Beyond standard usages known from vanilla Camel, Camel Quarkus adds the possibility to parse the Avro schema at build time both in JVM and Native mode.

The approach to generate Avro classes from Avro schema files is the one coined by the quarkus-avro extension. It requires the following:

  1. Store *.avsc files in a folder named src/main/avro or src/test/avro
  2. In addition to the usual build goal of quarkus-maven-plugin, add the generate-code goal:

    <plugin>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <executions>
            <execution>
                <id>generate-code-and-build</id>
                <goals>
                    <goal>generate-code</goal>
                    <goal>build</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    Copy to Clipboard Toggle word wrap

See a working configuration in Camel Quarkus Avro integration test and Quarkus Avro integration test.

2.4. AWS 2 CloudWatch

Sending metrics to AWS CloudWatch.

2.4.1. What’s inside

Refer to the above link for usage and configuration details.

2.4.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-aws2-cw</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.4.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.5. AWS 2 DynamoDB

Store and retrieve data from AWS DynamoDB service or receive messages from AWS DynamoDB Stream using AWS SDK version 2.x.

2.5.1. What’s inside

Refer to the above links for usage and configuration details.

2.5.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-aws2-ddb</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.5.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.5.4. Additional Camel Quarkus configuration

If desired, it is possible to use the Quarkus Amazon DynamoDB extension in conjunction with Camel Quarkus AWS 2 DynamoDB. Note that this is fully optional and not mandatory at all. Follow the Quarkus documentation but beware of the following caveats:

  1. The client type apache has to be selected by configuring the following property:

    quarkus.dynamodb.sync-client.type=apache
    Copy to Clipboard Toggle word wrap
  2. The DynamoDbClient has to be made "unremovable" in the sense of Quarkus CDI reference so that Camel Quarkus is able to look it up at runtime. You can reach that e.g. by adding a dummy bean injecting DynamoDbClient:

    import jakarta.enterprise.context.ApplicationScoped;
    import io.quarkus.arc.Unremovable;
    import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
    
    @ApplicationScoped
    @Unremovable
    class UnremovableDynamoDbClient {
        @Inject
        DynamoDbClient dynamoDbClient;
    }
    Copy to Clipboard Toggle word wrap

2.6. AWS 2 Kinesis

Consume and produce records from AWS Kinesis Streams using AWS SDK version 2.x.

2.6.1. What’s inside

Refer to the above links for usage and configuration details.

2.6.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-aws2-kinesis</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.6.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.7. AWS 2 Lambda

Manage and invoke AWS Lambda functions using AWS SDK version 2.x.

2.7.1. What’s inside

Refer to the above link for usage and configuration details.

2.7.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-aws2-lambda</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.7.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.7.4. Additional Camel Quarkus configuration

Quarkus-amazon-lambda extension allows you to use Quarkus to build your AWS Lambdas, whereas Camel component manages (deploy, undeploy, …​) existing functions. Therefore, it is not possible to use quarkus-amazon-lambda as a client for Camel aws2-lambda extension.

2.8. AWS 2 S3 Storage Service

Store and retrieve objects from AWS S3 Storage Service.

2.8.1. What’s inside

Refer to the above link for usage and configuration details.

2.8.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-aws2-s3</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.8.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.8.4. Additional Camel Quarkus configuration

If desired, it is possible to use the Quarkus Amazon S3 extension in conjunction with Camel Quarkus AWS 2 S3 Storage Service. Note that this is fully optional and not mandatory at all. Follow the Quarkus documentation but beware of the following caveats:

  1. The client type apache has to be selected by configuring the following property:

    quarkus.s3.sync-client.type=apache
    Copy to Clipboard Toggle word wrap
  2. The S3Client has to be made "unremovable" in the sense of Quarkus CDI reference so that Camel Quarkus is able to look it up at runtime. You can reach that e.g. by adding a dummy bean injecting S3Client:

    import jakarta.enterprise.context.ApplicationScoped;
    import io.quarkus.arc.Unremovable;
    import software.amazon.awssdk.services.s3.S3Client;
    
    @ApplicationScoped
    @Unremovable
    class UnremovableS3Client {
        @Inject
        S3Client s3Client;
    }
    Copy to Clipboard Toggle word wrap

2.9. AWS 2 Simple Notification System (SNS)

Send messages to AWS Simple Notification Topic.

2.9.1. What’s inside

Refer to the above link for usage and configuration details.

2.9.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-aws2-sns</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.9.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.9.4. Additional Camel Quarkus configuration

If desired, it is possible to use the Quarkus Amazon SNS extension in conjunction with Camel Quarkus AWS 2 Simple Notification System (SNS). Note that this is fully optional and not mandatory at all. Follow the Quarkus documentation but beware of the following caveats:

  1. The client type apache has to be selected by configuring the following property:

    quarkus.sns.sync-client.type=apache
    Copy to Clipboard Toggle word wrap
  2. The SnsClient has to be made "unremovable" in the sense of Quarkus CDI reference so that Camel Quarkus is able to look it up at runtime. You can reach that e.g. by adding a dummy bean injecting SnsClient:

    import jakarta.enterprise.context.ApplicationScoped;
    import io.quarkus.arc.Unremovable;
    import software.amazon.awssdk.services.sns.SnsClient;
    
    @ApplicationScoped
    @Unremovable
    class UnremovableSnsClient {
        @Inject
        SnsClient snsClient;
    }
    Copy to Clipboard Toggle word wrap

2.10. AWS 2 Simple Queue Service (SQS)

Send and receive messages to/from AWS SQS.

2.10.1. What’s inside

Refer to the above link for usage and configuration details.

2.10.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-aws2-sqs</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.10.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.10.4. Additional Camel Quarkus configuration

If desired, it is possible to use the Quarkus Amazon SQS extension in conjunction with Camel Quarkus AWS 2 Simple Queue Service (SQS). Note that this is fully optional and not mandatory at all. Follow the Quarkus documentation but beware of the following caveats:

  1. The client type apache has to be selected by configuring the following property:

    quarkus.sqs.sync-client.type=apache
    Copy to Clipboard Toggle word wrap
  2. The SqsClient has to be made "unremovable" in the sense of Quarkus CDI reference so that Camel Quarkus is able to look it up at runtime. You can reach that e.g. by adding a dummy bean injecting SqsClient:

    import jakarta.enterprise.context.ApplicationScoped;
    import io.quarkus.arc.Unremovable;
    import software.amazon.awssdk.services.sqs.SqsClient;
    
    @ApplicationScoped
    @Unremovable
    class UnremovableSqsClient {
        @Inject
        SqsClient sqsClient;
    }
    Copy to Clipboard Toggle word wrap

2.11. Azure Event Hubs

The azure-eventhubs component that integrates Azure Event Hubs using AMQP protocol. Azure EventHubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers.

2.11.1. What’s inside

Refer to the above link for usage and configuration details.

2.11.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-azure-eventhubs</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.11.3. Usage

2.11.3.1. Micrometer metrics support

If you wish to enable the collection of Micrometer metrics for the Reactor Netty transports, then you should declare a dependency on quarkus-micrometer to ensure that they are available via the Quarkus metrics HTTP endpoint.

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-micrometer</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.11.4. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.12. Azure Key Vault

Manage secrets and keys in Azure Key Vault Service

2.12.1. What’s inside

Refer to the above link for usage and configuration details.

2.12.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-azure-key-vault</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.12.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.13. Azure ServiceBus

Send and receive messages to/from Azure Event Bus.

2.13.1. What’s inside

Refer to the above link for usage and configuration details.

2.13.2. Maven coordinates

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-azure-servicebus</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.14. Azure Storage Blob Service

Store and retrieve blobs from Azure Storage Blob Service using SDK v12.

2.14.1. What’s inside

Refer to the above link for usage and configuration details.

2.14.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-azure-storage-blob</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.14.3. Usage

2.14.3.1. Micrometer metrics support

If you wish to enable the collection of Micrometer metrics for the Reactor Netty transports, then you should declare a dependency on quarkus-micrometer to ensure that they are available via the Quarkus metrics HTTP endpoint.

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-micrometer</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.14.4. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.15. Azure Storage Queue Service

The azure-storage-queue component is used for storing and retrieving the messages to/from Azure Storage Queue using Azure SDK v12.

2.15.1. What’s inside

Refer to the above link for usage and configuration details.

2.15.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-azure-storage-queue</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.15.3. Usage

2.15.3.1. Micrometer metrics support

If you wish to enable the collection of Micrometer metrics for the Reactor Netty transports, then you should declare a dependency on quarkus-micrometer to ensure that they are available via the Quarkus metrics HTTP endpoint.

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-micrometer</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.15.4. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.16. Bean Validator

Validate the message body using the Java Bean Validation API.

2.16.1. What’s inside

Refer to the above link for usage and configuration details.

2.16.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-bean-validator</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.16.3. Usage

2.16.3.1. Configuring the ValidatorFactory

Implementation of this extension leverages the Quarkus Hibernate Validator extension.

Therefore it is not possible to configure the ValidatorFactory by Camel’s properties (constraintValidatorFactory, messageInterpolator, traversableResolver, validationProviderResolver and validatorFactory).

You can configure the ValidatorFactory by the creation of beans which will be injected into the default ValidatorFactory (created by Quarkus). See the Quarkus CDI documentation for more information.

2.16.3.2. Custom validation groups in native mode

When using custom validation groups in native mode, all the interfaces need to be registered for reflection (see the documentation).

Example:

@RegisterForReflection
public interface OptionalChecks {
}
Copy to Clipboard Toggle word wrap

2.16.4. Camel Quarkus limitations

It is not possible to describe your constraints as XML (by providing the file META-INF/validation.xml), only Java annotations are supported. This is caused by the limitation of the Quarkus Hibernate Validator extension (see the issue).

2.17. Bean

Invoke methods of Java beans

2.17.1. What’s inside

Refer to the above links for usage and configuration details.

2.17.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-bean</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.17.3. Usage

Except for invoking methods of beans available in Camel registry, Bean component and Bean method language can also invoke Quarkus CDI beans. For more details, Refer to the CDI and the Camel Bean component section of the User guide.

2.18. BeanIO

Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats).

2.18.1. What’s inside

Refer to the above link for usage and configuration details.

2.18.2. Maven coordinates

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-beanio</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.19. Bindy

Marshal and unmarshal between POJOs on one side and Comma separated values (CSV), fixed field length or key-value pair (KVP) formats on the other side using Camel Bindy

2.19.1. What’s inside

Refer to the above links for usage and configuration details.

2.19.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-bindy</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.19.3. Camel Quarkus limitations

When using camel-quarkus-bindy in native mode, only the build machine’s locale is supported.

For instance, on build machines with french locale, the code below:

BindyDataFormat dataFormat = new BindyDataFormat();
dataFormat.setLocale("ar");
Copy to Clipboard Toggle word wrap

formats numbers the arabic way in JVM mode as expected. However, it formats numbers the french way in native mode.

Without further tuning, the build machine’s default locale would be used. Another locale could be specified with the quarkus.native.user-language and quarkus.native.user-country configuration properties.

2.20. Browse

Inspect the messages received on endpoints supporting BrowsableEndpoint.

2.20.1. What’s inside

Refer to the above link for usage and configuration details.

2.20.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-browse</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.21. Cassandra CQL

Integrate with Cassandra 2.0 using the CQL3 API (not the Thrift API). Based on Cassandra Java Driver provided by DataStax.

2.21.1. What’s inside

Refer to the above link for usage and configuration details.

2.21.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-cassandraql</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.21.3. Additional Camel Quarkus configuration

In order to use Cassandra aggregation repositories like CassandraAggregationRepository in native mode, you must enable native serialization support.

In addition, if your exchange bodies are custom types, then they must be registered for serialization by annotating their class declaration with @RegisterForReflection(serialization = true).

2.22. CLI Connector

Runtime adapter connecting with Camel CLI

2.22.1. What’s inside

Refer to the above link for usage and configuration details.

2.22.2. Maven coordinates

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-cli-connector</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.22.3. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.cli.enabled

Sets whether to enable Camel CLI Connector support.

boolean

true

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.23. Control Bus

Manage and monitor Camel routes.

2.23.1. What’s inside

Refer to the above link for usage and configuration details.

2.23.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-controlbus</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.23.3. Usage

2.23.3.1. Statistics

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>
Copy to Clipboard Toggle word wrap
2.23.3.2. Languages

The following languages are supported for use in the Control Bus extension in Red Hat build of Apache Camel for Quarkus:

2.23.3.2.1. Bean

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>
Copy to Clipboard Toggle word wrap

In native mode, the bean class must be annotated with @RegisterForReflection.

2.23.3.2.2. Simple

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')}"
);
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

2.23.4. Camel Quarkus limitations

2.23.4.1. Statistics

The stats action is not available in native mode as JMX is not supported on GraalVM. Therefore, attempting to build a native image with the camel-quarkus-management extension on the classpath will result in a build failure.

This feature is not supported in Red Hat build of Apache Camel for Quarkus.

2.24. Core

Camel core functionality and basic Camel languages: Constant, ExchangeProperty, Header, Ref, Simple and Tokenize

2.24.1. What’s inside

Refer to the above links for usage and configuration details.

2.24.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-core</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.24.3. Additional Camel Quarkus configuration

2.24.3.1. Simple language
2.24.3.1.1. Using the OGNL notation

When using the OGNL notation from the simple language, the camel-quarkus-bean extension should be used.

For instance, the simple expression below is accessing the getAddress() method on the message body of type Client.

---
simple("${body.address}")
---
Copy to Clipboard Toggle word wrap

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.

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'")
---
Copy to Clipboard Toggle word wrap

As such, the class java.nio.ByteBuffer needs to be registered for reflection.

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");
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.

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
---
Copy to Clipboard Toggle word wrap

As such, the class PropertiesCustomBeanWithSetterInjection needs to be registered for reflection, note that field access could be omitted in this case.

Expand
Configuration propertyTypeDefault

quarkus.camel.bootstrap.enabled

When set to true, the CamelRuntime will be started automatically.

boolean

true

quarkus.camel.service.discovery.exclude-patterns

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 **org.apache.camel.spi.FactoryFinder mechanism.

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: META-INF/services/org/apache/camel/foo/*,META-INF/services/org/apache/camel/foo/**/bar

List of string

 

quarkus.camel.service.discovery.include-patterns

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 org.apache.camel.spi.FactoryFinder mechanism unless the given file is excluded via exclude-patterns.

Note that Camel Quarkus extensions may include some services by default. The services selected here added to those services and the exclusions defined in exclude-patterns are applied to the union set.

Example values: META-INF/services/org/apache/camel/foo/*,META-INF/services/org/apache/camel/foo/**/bar

List of string

 

quarkus.camel.service.registry.exclude-patterns

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: META-INF/services/org/apache/camel/foo/*,META-INF/services/org/apache/camel/foo/**/bar**

List of string

 

quarkus.camel.service.registry.include-patterns

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 exclude-patterns.

Note that Camel Quarkus extensions may include some services by default. The services selected here added to those services and the exclusions defined in exclude-patterns are applied to the union set.

Example values: META-INF/services/org/apache/camel/foo/*,META-INF/services/org/apache/camel/foo/**/bar

List of string

 

quarkus.camel.runtime-catalog.components

If true the Runtime Camel Catalog embedded in the application will contain JSON schemas of Camel components available in the application; otherwise component JSON schemas will not be available in the Runtime Camel Catalog and any attempt to access those will result in a RuntimeException.

Setting this to false helps to reduce the size of the native image. In JVM mode, there is no real benefit of setting this flag to false except for making the behavior consistent with native mode.

boolean

true

quarkus.camel.runtime-catalog.languages

If true the Runtime Camel Catalog embedded in the application will contain JSON schemas of Camel languages available in the application; otherwise language JSON schemas will not be available in the Runtime Camel Catalog and any attempt to access those will result in a RuntimeException.

Setting this to false helps to reduce the size of the native image. In JVM mode, there is no real benefit of setting this flag to false except for making the behavior consistent with native mode.

boolean

true

quarkus.camel.runtime-catalog.dataformats

If true the Runtime Camel Catalog embedded in the application will contain JSON schemas of Camel data formats available in the application; otherwise data format JSON schemas will not be available in the Runtime Camel Catalog and any attempt to access those will result in a RuntimeException.

Setting this to false helps to reduce the size of the native image. In JVM mode, there is no real benefit of setting this flag to false except for making the behavior consistent with native mode.

boolean

true

quarkus.camel.runtime-catalog.devconsoles

If true the Runtime Camel Catalog embedded in the application will contain JSON schemas of Camel dev consoles available in the application; otherwise dev console JSON schemas will not be available in the Runtime Camel Catalog and any attempt to access those will result in a RuntimeException.

Setting this to false helps to reduce the size of the native image. In JVM mode, there is no real benefit of setting this flag to false except for making the behavior consistent with native mode.

boolean

true

quarkus.camel.runtime-catalog.models

If true the Runtime Camel Catalog embedded in the application will contain JSON schemas of Camel EIP models available in the application; otherwise EIP model JSON schemas will not be available in the Runtime Camel Catalog and any attempt to access those will result in a RuntimeException.

Setting this to false helps to reduce the size of the native image. In JVM mode, there is no real benefit of setting this flag to false except for making the behavior consistent with native mode.

boolean

true

quarkus.camel.runtime-catalog.transformers

If true the Runtime Camel Catalog embedded in the application will contain JSON schemas of Camel transformers available in the application; otherwise transformer JSON schemas will not be available in the Runtime Camel Catalog and any attempt to access those will result in a RuntimeException.

Setting this to false helps to reduce the size of the native image. In JVM mode, there is no real benefit of setting this flag to false except for making the behavior consistent with native mode.

boolean

true

quarkus.camel.routes-discovery.enabled

Enable automatic discovery of routes during static initialization.

boolean

true

quarkus.camel.routes-discovery.exclude-patterns

Used for exclusive filtering scanning of RouteBuilder classes. The exclusive filtering takes precedence over inclusive filtering. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma. For example to exclude all classes starting with Bar use: **/Bar* To exclude all routes form a specific package use: com/mycompany/bar/* To exclude all routes form a specific package and its sub-packages use double wildcards: com/mycompany/bar/** And to exclude all routes from two specific packages use: com/mycompany/bar/*,com/mycompany/stuff/*

List of string

 

quarkus.camel.routes-discovery.include-patterns

Used for inclusive filtering scanning of RouteBuilder classes. The exclusive filtering takes precedence over inclusive filtering. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma. For example to include all classes starting with Foo use: **/Foo* To include all routes form a specific package use: com/mycompany/foo/* To include all routes form a specific package and its sub-packages use double wildcards: com/mycompany/foo/** And to include all routes from two specific packages use: com/mycompany/foo/*,com/mycompany/stuff/*

List of string

 

quarkus.camel.native.reflection.exclude-patterns

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 java.lang.Class.getName() method: package segments delimited by period . and inner classes by dollar sign $.

This option narrows down the set selected by include-patterns. By default, no classes are excluded.

This option cannot be used to unregister classes which have been registered internally by Quarkus extensions.

List of string

 

quarkus.camel.native.reflection.include-patterns

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 java.lang.Class.getName() method: package segments delimited by period . and inner classes by dollar sign $.

By default, no classes are included. The set selected by this option can be narrowed down by exclude-patterns.

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 io.quarkus.runtime.annotations.RegisterForReflection annotation in your Java code.

For this option to work properly, at least one of the following conditions must be satisfied:

- There are no wildcards (* or /) in the patterns - The artifacts containing the selected classes contain a Jandex index (META-INF/jandex.idx) - The artifacts containing the selected classes are registered for indexing using the quarkus.index-dependency.* family of options in application.properties - e.g.

` quarkus.index-dependency.my-dep.group-id = org.my-group quarkus.index-dependency.my-dep.artifact-id = my-artifact `

where my-dep is a label of your choice to tell Quarkus that org.my-group and with my-artifact belong together.

List of string

 

quarkus.camel.native.reflection.serialization-enabled

If true, basic classes are registered for serialization; otherwise basic classes won’t be registered automatically for serialization in native mode. The list of classes automatically registered for serialization can be found in CamelSerializationProcessor.BASE_SERIALIZATION_CLASSES. Setting this to false helps to reduce the size of the native image. In JVM mode, there is no real benefit of setting this flag to true except for making the behavior consistent with native mode.

boolean

false

quarkus.camel.csimple.on-build-time-analysis-failure

What to do if it is not possible to extract CSimple expressions from a route definition at build time.

fail, warn, ignore

warn

quarkus.camel.expression.on-build-time-analysis-failure

What to do if it is not possible to extract expressions from a route definition at build time.

fail, warn, ignore

warn

quarkus.camel.expression.extraction-enabled

Indicates whether the expression extraction from the route definitions at build time must be done. If disabled, the expressions are compiled at runtime.

boolean

true

quarkus.camel.event-bridge.enabled

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 org.apache.camel.quarkus.core.events, org.apache.camel.quarkus.main.events & org.apache.camel.impl.event packages.

Note that this configuration item only has any effect when observers configured for Camel events are present in the application.

boolean

true

quarkus.camel.source-location-enabled

Build time configuration options for enable/disable camel source location.

boolean

false

quarkus.camel.trace.enabled

Enables tracer in your Camel application.

boolean

false

quarkus.camel.trace.standby

To set the tracer in standby mode, where the tracer will be installed, but not automatically enabled. The tracer can then be enabled explicitly later from Java, JMX or tooling.

boolean

false

quarkus.camel.trace.backlog-size

Defines how many of the last messages to keep in the tracer.

int

1000

quarkus.camel.trace.remove-on-dump

Whether all traced messages should be removed when the tracer is dumping. By default, the messages are removed, which means that dumping will not contain previous dumped messages.

boolean

true

quarkus.camel.trace.body-max-chars

To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.

int

131072

quarkus.camel.trace.body-include-streams

Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching.

boolean

false

quarkus.camel.trace.body-include-files

Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file.

boolean

true

quarkus.camel.trace.include-exchange-properties

Whether to include the exchange properties in the traced message.

boolean

true

quarkus.camel.trace.include-exchange-variables

Whether to include the exchange variables in the traced message.

boolean

true

quarkus.camel.trace.include-exception

Whether to include the exception in the traced message in case of failed exchange.

boolean

true

quarkus.camel.trace.trace-rests

Whether to trace routes that is created from Rest DSL.

boolean

false

quarkus.camel.trace.trace-templates

Whether to trace routes that is created from route templates or kamelets.

boolean

false

quarkus.camel.trace.trace-pattern

Filter for tracing by route or node id.

string

 

quarkus.camel.trace.trace-filter

Filter for tracing messages.

string

 

quarkus.camel.type-converter.statistics-enabled

Whether type converter statistics are enabled. By default, type converter utilization statistics are disabled. Note that enabling statistics incurs a minor performance impact under very heavy load.

boolean

false

quarkus.camel.main.shutdown.timeout

A timeout (with millisecond precision) to wait for CamelMain#stop() to finish

Duration image::icons/circle-question.svg[title=More information about the Duration format]

PT3S

quarkus.camel.main.arguments.on-unknown

The action to take when CamelMain encounters an unknown argument. fail - Prints the CamelMain usage statement and throws a RuntimeException ignore - Suppresses any warnings and the application startup proceeds as normal warn - Prints the CamelMain usage statement but allows the application startup to proceed as normal

fail, warn, ignore

warn

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

About the Duration format

To write duration values, use the standard java.time.Duration format. See the Duration#parse() Java API documentation for more information.

You can also use a simplified format, starting with a number:

  • If the value is only a number, it represents time in seconds.
  • If the value is a number followed by ms, it represents time in milliseconds.

In other cases, the simplified format is translated to the java.time.Duration format for parsing:

  • If the value is a number followed by h, m, or s, it is prefixed with PT.
  • If the value is a number followed by d, it is prefixed with P.

2.25. Cron

A generic interface for triggering events at times specified through the Unix cron syntax.

2.25.1. What’s inside

Refer to the above link for usage and configuration details.

2.25.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-cron</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.25.3. Additional Camel Quarkus configuration

The cron component is a generic interface component, as such Camel Quarkus users will need to use the cron extension together with another extension offering an implementation. For instance, one can use the Quartz Extension and cron extension together in its project.

2.26. Crypto (JCE)

Sign and verify exchanges using the Signature Service of the Java Cryptographic Extension (JCE).

2.26.1. What’s inside

Refer to the above links for usage and configuration details.

2.26.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-crypto</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.26.3. Usage

2.26.3.1. Security Provider

Extension requires BouncyCastle provider and also utilizes the quarkus security extension (see security providers registration doc) If there is no BC* provider registered (by quarkus.security.security-providers property). The BC provider is registered.

2.26.3.2. FIPS

When running the crypto extension on FIPS enabled system any FIPS-compliant Java Security Provider (such as BCFIPS) has to be used.

  • In the case of BCFIPS, add BCFIPS dependency and quarkus-security (see the guide for more information)
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bc-fips</artifactId>
</dependency>
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-security</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

and register BCFIPS provider with following proprerty:

quarkus.security.security-providers=BCFIPS
Copy to Clipboard Toggle word wrap
  • Alternatively, you can add different FIPS compliant provider. Make Sure that the provider is registered.

2.26.4. Camel Quarkus limitations

2.26.5. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.27. CXF

Expose SOAP WebServices using Apache CXF or connect to external WebServices using CXF WS client.

2.27.1. What’s inside

Refer to the above link for usage and configuration details.

2.27.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-cxf-soap</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.27.3. Usage

2.27.3.1. General

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.

Important

To learn about supported use cases and WS specifications, see the Quarkus CXF Reference.

2.27.3.2. Dependency management

The CXF and quarkus-cxf versions are managed by {project-name}. You do not need select compatible versions for those projects.

2.27.3.3. Client

With camel-quarkus-cxf-soap (no additional dependencies required), you can use CXF clients as producers in Camel routes:

import org.apache.camel.builder.RouteBuilder;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.SessionScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Named;

@ApplicationScoped
public class CxfSoapClientRoutes extends RouteBuilder {

    @Override
    public void configure() {

        /* You can either configure the client inline */
        from("direct:cxfUriParamsClient")
                .to("cxf://http://localhost:8082/calculator-ws?wsdlURL=wsdl/CalculatorService.wsdl&dataFormat=POJO&serviceClass=org.foo.CalculatorService");

        /* Or you can use a named bean produced below by beanClient() method */
        from("direct:cxfBeanClient")
                .to("cxf:bean:beanClient?dataFormat=POJO");

    }

    @Produces
    @SessionScoped
    @Named
    CxfEndpoint beanClient() {
        final CxfEndpoint result = new CxfEndpoint();
        result.setServiceClass(CalculatorService.class);
        result.setAddress("http://localhost:8082/calculator-ws");
        result.setWsdlURL("wsdl/CalculatorService.wsdl"); // a resource in the class path
        return result;
    }
}
Copy to Clipboard Toggle word wrap

The CalculatorService may look like the following:

import jakarta.jws.WebMethod;
import jakarta.jws.WebService;

@WebService(targetNamespace = CalculatorService.TARGET_NS) 
1

public interface CalculatorService {

    public static final String TARGET_NS = "http://acme.org/wscalculator/Calculator";

    @WebMethod 
2

    public int add(int intA, int intB);

    @WebMethod 
3

    public int subtract(int intA, int intB);

    @WebMethod 
4

    public int divide(int intA, int intB);

    @WebMethod 
5

    public int multiply(int intA, int intB);
}
Copy to Clipboard Toggle word wrap
1 2 3 4 5
NOTE: JAX-WS annotations are required. The Simple CXF Frontend is not supported. Complex parameter types require JAXB annotations to work in properly in native mode.
Tip

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
Copy to Clipboard Toggle word wrap
Note

quarkus-cxf supports injecting SOAP clients using @io.quarkiverse.cxf.annotation.CXFClient annotation. Refer to the SOAP Clients chapter of quarkus-cxf user guide for more details.

2.27.3.4. Server

With camel-quarkus-cxf-soap, you can expose SOAP endpoints as consumers in Camel routes. No additional dependencies are required for this use case.

import org.apache.camel.builder.RouteBuilder;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Named;

@ApplicationScoped
public class CxfSoapRoutes extends RouteBuilder {

    @Override
    public void configure() {
        /* A CXF Service configured through a CDI bean */
        from("cxf:bean:helloBeanEndpoint")
                .setBody().simple("Hello ${body} from CXF service");

        /* A CXF Service configured through Camel URI parameters */
        from("cxf:///hello-inline?wsdlURL=wsdl/HelloService.wsdl&serviceClass=org.foo.HelloService")
                        .setBody().simple("Hello ${body} from CXF service");
    }

    @Produces
    @ApplicationScoped
    @Named
    CxfEndpoint helloBeanEndpoint() {
        final CxfEndpoint result = new CxfEndpoint();
        result.setServiceClass(HelloService.class);
        result.setAddress("/hello-bean");
        result.setWsdlURL("wsdl/HelloService.wsdl");
        return result;
    }
}
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

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.

Important

Do not use quarkus.cxf.path = / in your application unless you are 100% sure that no other extension will want to expose HTTP endpoints.

Before quarkus-cxf 2.0.0 (i.e. before {project-name} 3.0.0), the default value of quarkus.cxf.path was /. The default was changed because it prevented other Quarkus extensions from exposing any further HTTP endpoints. Among others, RESTEasy, Vert.x, SmallRye Health (no health endpoints exposed!) were impacted by this.

Note

quarkus-cxf supports alternative ways of exposing SOAP endpoints. Refer to the SOAP Services chapter of quarkus-cxf user guide for more details.

2.27.3.5. Logging of requests and responses

You can enable verbose logging of SOAP messages for both clients and servers with org.apache.cxf.ext.logging.LoggingFeature:

import org.apache.camel.builder.RouteBuilder;
import org.apache.cxf.ext.logging.LoggingFeature;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.SessionScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Named;

@ApplicationScoped
public class MyBeans {

    @Produces
    @ApplicationScoped
    @Named("prettyLoggingFeature")
    public LoggingFeature prettyLoggingFeature() {
        final LoggingFeature result = new LoggingFeature();
        result.setPrettyLogging(true);
        return result;
    }

    @Inject
    @Named("prettyLoggingFeature")
    LoggingFeature prettyLoggingFeature;

    @Produces
    @SessionScoped
    @Named
    CxfEndpoint cxfBeanClient() {
        final CxfEndpoint result = new CxfEndpoint();
        result.setServiceClass(CalculatorService.class);
        result.setAddress("https://acme.org/calculator");
        result.setWsdlURL("wsdl/CalculatorService.wsdl");
        result.getFeatures().add(prettyLoggingFeature);
        return result;
    }

    @Produces
    @ApplicationScoped
    @Named
    CxfEndpoint helloBeanEndpoint() {
        final CxfEndpoint result = new CxfEndpoint();
        result.setServiceClass(HelloService.class);
        result.setAddress("/hello-bean");
        result.setWsdlURL("wsdl/HelloService.wsdl");
        result.getFeatures().add(prettyLoggingFeature);
        return result;
    }
}
Copy to Clipboard Toggle word wrap
Note

The support for org.apache.cxf.ext.logging.LoggingFeature is provided by io.quarkiverse.cxf:quarkus-cxf-rt-features-logging as a camel-quarkus-cxf-soap dependency. You do not need to add it explicitly to your application.

2.27.3.6. WS Specifications

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.

Tip

Both {project-name} and Quarkus CXF contain a number of integration tests which can serve as executable examples of applications that implement various WS specifications.

2.27.3.7. Tooling

quarkus-cxf wraps the following two CXF tools:

Important

For wsdl2Java to work properly, your application will have to directly depend on io.quarkiverse.cxf:quarkus-cxf.

Tip

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
Copy to Clipboard Toggle word wrap

2.27.4. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.cxf.class-generation.exclude-patterns

For CXF service interfaces to work properly, some ancillary classes (such as request and response wrappers) need to be generated at build time. Camel Quarkus lets the quarkus-cxf extension to do this for all service interfaces found in the class path except the ones matching the patterns in this property.

org.apache.cxf.ws.security.sts.provider.SecurityTokenService is excluded by default due to https://issues.apache.org/jira/browse/CXF-8834

List of string

org.apache.cxf.ws.security.sts.provider.SecurityTokenService

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.28. Data Format

Use a Camel Data Format as a regular Camel Component. For more details of the supported data formats in {project-name}, see Supported Data Formats.

2.28.1. What’s inside

Refer to the above link for usage and configuration details.

2.28.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-dataformat</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.29. Dataset

Provide data for load and soak testing of your Camel application.

2.29.1. What’s inside

Refer to the above links for usage and configuration details.

2.29.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-dataset</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.30. Direct

Call another endpoint from the same Camel Context synchronously.

2.30.1. What’s inside

Refer to the above link for usage and configuration details.

2.30.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-direct</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.31. Elasticsearch

Send requests to ElasticSearch via Java Client API.

2.31.1. What’s inside

Refer to the above link for usage and configuration details.

2.31.2. Maven coordinates

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-elasticsearch</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.32. Elasticsearch Low level Rest Client

Perform queries and other operations on Elasticsearch or OpenSearch (uses low-level client).

2.32.1. What’s inside

Refer to the above link for usage and configuration details.

2.32.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-elasticsearch-rest-client</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.33. FHIR

Exchange information in the healthcare domain using the FHIR (Fast Healthcare Interoperability Resources) standard. Marshall and unmarshall FHIR objects to/from JSON. Marshall and unmarshall FHIR objects to/from XML.

2.33.1. What’s inside

Refer to the above links for usage and configuration details.

2.33.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-fhir</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.33.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.33.4. Additional Camel Quarkus configuration

By default, only FHIR versions R4 & DSTU3 are enabled in native mode, since they are the default values on the FHIR component and DataFormat.

Expand
Configuration propertyTypeDefault

quarkus.camel.fhir.enable-dstu2

Enable FHIR DSTU2 Specs in native mode.

boolean

false

quarkus.camel.fhir.enable-dstu2_hl7org

Enable FHIR DSTU2_HL7ORG Specs in native mode.

boolean

false

quarkus.camel.fhir.enable-dstu2_1

Enable FHIR DSTU2_1 Specs in native mode.

boolean

false

quarkus.camel.fhir.enable-dstu3

Enable FHIR DSTU3 Specs in native mode.

boolean

false

quarkus.camel.fhir.enable-r4

Enable FHIR R4 Specs in native mode.

boolean

true

quarkus.camel.fhir.enable-r5

Enable FHIR R5 Specs in native mode.

boolean

false

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.34. File

Read and write files.

2.34.1. What’s inside

Refer to the above link for usage and configuration details.

2.34.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-file</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.35. File Cluster Service

Provides a FileLock implementation of the Camel Cluster Service SPI

2.35.1. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-file-cluster-service</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.35.2. Additional Camel Quarkus configuration

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");
Copy to Clipboard Toggle word wrap

It’s possible to configure the file cluster service with a property like below:

quarkus.camel.cluster.file.root = target/cluster-folder-where-lock-file-will-be-held
Copy to Clipboard Toggle word wrap

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.

Expand
Configuration propertyTypeDefault

quarkus.camel.cluster.file.enabled

Whether a File Lock Cluster Service should be automatically configured according to 'quarkus.camel.cluster.file.*' configurations.

boolean

true

quarkus.camel.cluster.file.id

The cluster service ID (defaults to null).

string

 

quarkus.camel.cluster.file.root

The root path (defaults to null).

string

 

quarkus.camel.cluster.file.order

The service lookup order/priority (defaults to 2147482647).

int

 

[[quarkus-camel-cluster-file-attributes—​attributes]] quarkus.camel.cluster.file.attributes."attributes"

The custom attributes associated to the service (defaults to empty map).

Map<String,String>

 

quarkus.camel.cluster.file.acquire-lock-delay

The time to wait before starting to try to acquire lock (defaults to 1000ms).

string

 

quarkus.camel.cluster.file.acquire-lock-interval

The time to wait between attempts to try to acquire lock (defaults to 10000ms).

string

 

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.37. FTP

Upload and download files to/from SFTP, FTP or SFTP servers

2.37.1. What’s inside

Refer to the above links for usage and configuration details.

2.37.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-ftp</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.38. Google BigQuery

Access Google Cloud BigQuery service using SQL queries or Google Client Services API

2.38.1. What’s inside

Refer to the above links for usage and configuration details.

2.38.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-google-bigquery</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.38.3. Usage

If you want to read SQL scripts from the classpath with google-bigquery-sql in native mode, then you will need to ensure that they are added to the native image via the quarkus.native.resources.includes configuration property. Check Quarkus documentation for more details.

2.39. Google Pubsub

Send and receive messages to/from Google Cloud Platform PubSub Service.

2.39.1. What’s inside

Refer to the above link for usage and configuration details.

2.39.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-google-pubsub</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.39.3. Camel Quarkus limitations

By default, the Camel PubSub component uses JDK object serialization via ObjectOutputStream whenever the message body is anything other than String or byte[].

Since such serialization is not yet supported by GraalVM, this extension provides a custom Jackson based serializer to serialize complex message payloads as JSON.

If your payload contains binary data, then you will need to handle that by creating a custom Jackson Serializer / Deserializer. Refer to the Quarkus Jackson guide for information on how to do this.

2.40. Google Secret Manager

Manage Google Secret Manager Secrets

2.40.1. What’s inside

Refer to the above link for usage and configuration details.

2.40.2. Maven coordinates

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-google-secret-manager</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.41. GraphQL

Send GraphQL queries and mutations to external systems.

2.41.1. What’s inside

Refer to the above link for usage and configuration details.

2.41.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-graphql</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.41.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.41.4. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.graphql.query-files

A comma separated list of paths to files containing GraphQL queries for use by GraphQL endpoints. Query files that only need to be accessible from the classpath should be specified on this property. Paths can either be schemeless (E.g graphql/my-query.graphql) or be prefixed with the classpath: URI scheme (E.g classpath:graphql/my-query.graphql). Other URI schemes are not supported.

List of string

 

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.42. gRPC

Expose gRPC endpoints and access external gRPC endpoints.

2.42.1. What’s inside

Refer to the above link for usage and configuration details.

2.42.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-grpc</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.42.3. Usage

2.42.3.1. Protobuf generated code

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.

<build>
    <plugins>
        <plugin>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-maven-plugin</artifactId>
            <version>${quarkus.platform.version}</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                    <goals>
                        <goal>build</goal>
                        <goal>generate-code</goal>
                        <goal>generate-code-tests</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
Copy to Clipboard Toggle word wrap

With this configuration, you can put your service and message definitions into the src/main/proto directory and the quarkus-maven-plugin will generate code from your .proto files.

2.42.3.1.1. Scanning proto files with imports

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 in src/main/proto or src/test/proto
  • groupId1:artifactId1,groupId2:artifactId2 - Scan only the dependencies matching the groupId and artifactId list

The default value is com.google.protobuf:protobuf-java.

2.42.3.1.2. Scanning proto files from dependencies

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
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap
Note

The : character within property keys must be escaped with \.

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
Copy to Clipboard Toggle word wrap

More information about selecting resources for inclusion in the native executable can be found in the native mode guide.

2.42.4. Camel Quarkus limitations

At present there is no support for integrating Camel Quarkus gRPC with Quarkus gRPC. If you have both the camel-quarkus-grpc and quarkus-grpc extension dependency on the classpath, you are likely to encounter problems at build time when compiling your application.

2.42.5. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.grpc.codegen.enabled

If true, Camel Quarkus gRPC code generation is run for .proto files discovered from the proto directory, or from dependencies specified in the scan-for-proto or scan-for-imports options. When false, code generation for .proto files is disabled.

boolean

true

quarkus.camel.grpc.codegen.scan-for-proto

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

string

none

quarkus.camel.grpc.codegen.scan-for-imports

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.

string

com.google.protobuf:protobuf-java

[[quarkus-camel-grpc-codegen-scan-for-proto-includes—​scan-for-proto-includes]] quarkus.camel.grpc.codegen.scan-for-proto-includes."scan-for-proto-includes"

Package path or file glob pattern includes per dependency containing .proto files to be considered for inclusion.

Map<String,List<String>>

 

[[quarkus-camel-grpc-codegen-scan-for-proto-excludes—​scan-for-proto-excludes]] quarkus.camel.grpc.codegen.scan-for-proto-excludes."scan-for-proto-excludes"

Package path or file glob pattern includes per dependency containing .proto files to be considered for exclusion.

Map<String,List<String>>

 

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.43. Gson

Marshal POJOs to JSON and back using Gson

2.43.1. What’s inside

Refer to the above link for usage and configuration details.

2.43.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-gson</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.43.3. Additional Camel Quarkus configuration

When marshaling/unmarshaling objects in native mode, all the serialized classes need to be registered for reflection. As such, when using GsonDataFormat.setUnmarshalType(…​), GsonDataFormat.setUnmarshalTypeName(…​) and even GsonDataFormat.setUnmarshalGenericType(…​), the unmarshal type as well as sub field types should be registered for reflection. See a working example in this integration test.

2.44. HL7

Marshal and unmarshal HL7 (Health Care) model objects using the HL7 MLLP codec.

2.44.1. What’s inside

Refer to the above links for usage and configuration details.

2.44.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-hl7</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.44.3. Camel Quarkus limitations

For MLLP with TCP, Netty is the only supported means of running an Hl7 MLLP listener. Mina is not supported since it has no GraalVM native support at present.

Optional support for HL7MLLPNettyEncoderFactory & HL7MLLPNettyDecoderFactory codecs can be obtained by adding a dependency in your project pom.xml to camel-quarkus-netty.

2.45. HTTP

Send requests to external HTTP servers using Apache HTTP Client 5.x.

2.45.1. What’s inside

Refer to the above links for usage and configuration details.

2.45.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-http</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.45.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.45.4. Additional Camel Quarkus configuration

  • Check the Character encodings section of the Native mode guide if you expect your application to send or receive requests using non-default encodings.

2.46. Hashicorp Vault

Manage secrets in Hashicorp Vault Service

2.46.1. What’s inside

Refer to the above link for usage and configuration details.

2.46.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-hashicorp-vault</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.46.3. Usage

It is possible to use a POJO as the message body for the createSecret operation. In native mode, you must register any such POJO classes for reflection. E.g. via the @RegisterForReflection annotation or configuration property quarkus.camel.native.reflection.include-patterns.

For example.

@RegisterForReflection
public class Credentials {
    private String username;
    private String password;

    // Getters & setters
}
Copy to Clipboard Toggle word wrap
from("direct:createSecret")
    .process(new Processor() {
        @Override
        public void process(Exchange exchange) {
            Credentials credentials = new Credentials();
            credentials.setUsername("admin");
            credentials.setPassword("2s3cr3t");
            exchange.getMessage().setBody(credentials);
        }
    })
    .to("hashicorp-vault:secret?operation=createSecret&token=my-token&secretPath=my-secret")
Copy to Clipboard Toggle word wrap

Refer to the Native mode user guide for more information.

2.47. Infinispan

Read and write from/to Infinispan distributed key/value store and data grid.

2.47.1. What’s inside

Refer to the above link for usage and configuration details.

2.47.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-infinispan</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.47.3. Usage

2.47.3.1. Infinispan client configuration

You can configure Camel Infinispan in one of two ways.

More details about these two configuration methods is described below.

When using 'pure' Camel Infinispan component and endpoint configuration (I.e where’s there’s no quarkus.infinispan-client configuration set), you must disable generation of the default Quarkus Infinispan RemoteCacheManager bean by adding the following configuration to application.properties.

quarkus.infinispan-client.devservices.create-default-client=false
Copy to Clipboard Toggle word wrap

If you wish to take advantage of Quarkus Dev Services for Infinispan, the Camel Infinispan component can be configured as follows in application.properties.

# dev / test mode Quarkus Infinispan Dev services configuration
quarkus.infinispan-client.devservices.port=31222
%dev,test.camel.component.infinispan.username=admin
%dev,test.camel.component.infinispan.password=password
%dev,test.camel.component.infinispan.secure=true
%dev,test.camel.component.infinispan.hosts=localhost:31222

# Example prod mode configuration
%prod.camel.component.infinispan.username=prod-user
%prod.camel.component.infinispan.password=prod-password
%prod.camel.component.infinispan.secure=true
%prod.camel.component.infinispan.hosts=infinispan.prod:11222
Copy to Clipboard Toggle word wrap
2.47.3.3. Quarkus Infinispan configuration

When using the Quarkus Infinispan extension configuration properties, the Quarkus Infinispan extensions creates and manages a RemoteCacheManager bean.

The bean will get automatically autowired into the Camel Infinispan component on application startup.

Note that to materialize the RemoteCacheManager beans, you must add injection points for them. For example:

public class Routes extends RouteBuilder {
    // Injects the default unnamed RemoteCacheManager
    @Inject
    RemoteCacheManager cacheManager;

    // If configured, injects an optional named RemoteCacheManager
    @Inject
    @InfinispanClientName("myNamedClient")
    RemoteCacheManager namedCacheManager;

    @Override
    public void configure() {
        // Route configuration here...
    }
}
Copy to Clipboard Toggle word wrap

2.47.4. Additional Camel Quarkus configuration

If you chose to use the InfinispanRemoteAggregationRepository in native mode, then you must enable native serialization support.

2.48. Avro Jackson

Marshal POJOs to Avro and back using Jackson.

2.48.1. What’s inside

Refer to the above link for usage and configuration details.

2.48.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jackson-avro</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.49. Protobuf Jackson

Marshal POJOs to Protobuf and back using Jackson.

2.49.1. What’s inside

Refer to the above link for usage and configuration details.

2.49.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jackson-protobuf</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.50. Jackson

Marshal POJOs to JSON and back using Jackson

2.50.1. What’s inside

Refer to the above link for usage and configuration details.

2.50.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jackson</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.50.3. Usage

2.50.3.1. Configuring the Jackson ObjectMapper

There are a few ways of configuring the ObjectMapper that the JacksonDataFormat uses. These are outlined below.

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.

You can pass a custom ObjectMapper instance to JacksonDataFormat as follows.

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.jackson.JacksonDataFormat;

public class Routes extends RouteBuilder {
    public void configure() {
        ObjectMapper mapper = new ObjectMapper();
        JacksonDataFormat dataFormat = new JacksonDataFormat();
        dataFormat.setObjectMapper(mapper);
        // Use the dataFormat instance in a route definition
        from("direct:my-direct").marshal(dataFormat)
    }
}
Copy to Clipboard Toggle word wrap

The Quarkus Jackson extension exposes an ObjectMapper CDI bean which can be discovered by the JacksonDataFormat.

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.jackson.JacksonDataFormat;

public class Routes extends RouteBuilder {
    public void configure() {
        JacksonDataFormat dataFormat = new JacksonDataFormat();
        // Make JacksonDataFormat discover the Quarkus Jackson `ObjectMapper` from the Camel registry
        dataFormat.setAutoDiscoverObjectMapper(true);
        // Use the dataFormat instance in a route definition
        from("direct:my-direct").marshal(dataFormat)
    }
}
Copy to Clipboard Toggle word wrap

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.

import org.apache.camel.builder.RouteBuilder;

@ApplicationScoped
public class Routes extends RouteBuilder {
    public void configure() {
        restConfiguration().dataFormatProperty("autoDiscoverObjectMapper", "true");
        // REST definition follows...
    }
}
Copy to Clipboard Toggle word wrap

You can perform customizations on the Quarkus ObjectMapper with a ObjectMapperCustomizer.

import com.fasterxml.jackson.databind.ObjectMapper;
import io.quarkus.jackson.ObjectMapperCustomizer;

@Singleton
public class RegisterCustomModuleCustomizer implements ObjectMapperCustomizer {
    public void customize(ObjectMapper mapper) {
        mapper.registerModule(new CustomModule());
    }
}
Copy to Clipboard Toggle word wrap

It’s also possible to @Inject the Quarkus ObjectMapper and pass it to the JacksonDataFormat.

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.jackson.JacksonDataFormat;

@ApplicationScoped
public class Routes extends RouteBuilder {
    @Inject
    ObjectMapper mapper;

    public void configure() {
        JacksonDataFormat dataFormat = new JacksonDataFormat();
        dataFormat.setObjectMapper(mapper);
        // Use the dataFormat instance in a route definition
        from("direct:my-direct").marshal(dataFormat)
    }
}
Copy to Clipboard Toggle word wrap

2.51. JacksonXML

Unmarshal an XML payloads to POJOs and back using XMLMapper extension of Jackson.

2.51.1. What’s inside

Refer to the above link for usage and configuration details.

2.51.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jacksonxml</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.52. Jasypt

Security using Jasypt

2.52.1. What’s inside

Refer to the above link for usage and configuration details.

2.52.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jasypt</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.52.3. Usage

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"
Copy to Clipboard Toggle word wrap
Important

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)
Copy to Clipboard Toggle word wrap

In your Camel routes, you can refer to the property name using the standard placeholder syntax and its value will get decrypted.

public class MySecureRoute extends RouteBuilder {
    @Override
    public void configure() {
        from("timer:tick?period=5s")
            .to("{{my.secret}}");
    }
}
Copy to Clipboard Toggle word wrap
Tip

You can use the ability to mask security sensitive configuration in Camel by suffixing property values with .secret. You can also disable the startup configuration summary with the configuration camel.main.autoConfigurationLogSummary = false.

2.52.3.1. Injecting encrypted configuration

You can use the @ConfigProperty annotation to inject encrypted configuration into your Camel routes or CDI beans.

@ApplicationScoped
public class MySecureRoute extends RouteBuilder {
    @ConfigInject("my.secret")
    String mySecret;

    @Override
    public void configure() {
        from("timer:tick?period=5s")
            .to(mySecret);
    }
}
Copy to Clipboard Toggle word wrap

If you prefer to keep your secret configuration in a file separate to application.properties, you can use the quarkus.config.locations configuration option to specify additional configuration files.

In native mode you must also add any additional configuration file resource paths to quarkus.native.resources.includes.

2.52.3.1.2. Finer control of Jasypt configuration

If you require finer control of the Jasypt configuration than that provided by the default configuration, the following options are available.

2.52.3.1.2.1. JasyptConfigurationCustomizer

Implement a JasyptConfigurationCustomizer class to customize any aspect of the Jasypt EnvironmentStringPBEConfig.

package org.acme;

import org.apache.camel.quarkus.component.jasypt.JasyptConfigurationCustomizer;
import org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig;
import org.jasypt.iv.RandomIvGenerator;
import org.jasypt.salt.RandomSaltGenerator;

public class JasyptConfigurationCustomizer implements JasyptConfigurationCustomizer {
    public void customize(EnvironmentStringPBEConfig config) {
        // Custom algorithms
        config.setAlgorithm("PBEWithHmacSHA256AndAES_256");
        config.setSaltGenerator(new RandomSaltGenerator("PKCS11"));
        config.setIvGenerator(new RandomIvGenerator("PKCS11"));
        // Additional customizations...
    }
}
Copy to Clipboard Toggle word wrap

In application.properties add the quarkus.camel.jasypt.configuration-customizer-class-name configuration property.

quarkus.camel.jasypt.configuration-customizer-class-name = org.acme.MyJasyptEncryptorCustomizer
Copy to Clipboard Toggle word wrap

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.

Note

In this mode, you cannot use the @ConfigProperty annotation to inject encrypted configuration properties.

import org.apache.camel.CamelContext;
import org.apache.camel.component.jasypt.JasyptPropertiesParser;
import org.apache.camel.component.properties.PropertiesComponent;

public class MySecureRoute extends RouteBuilder {
    @Override
    public void configure() {
        JasyptPropertiesParser jasypt = new JasyptPropertiesParser();
        jasypt.setPassword("secret");

        PropertiesComponent component = (PropertiesComponent) getContext().getPropertiesComponent();
        jasypt.setPropertiesComponent(component);
        component.setPropertiesParser(jasypt);

        from("timer:tick?period=5s")
            .to("{{my.secret}}");
    }
}
Copy to Clipboard Toggle word wrap
Note

If you call setLocation(…​) on the PropertiesComponent to specify a custom configuration file location using the classpath: prefix, you must add the file to quarkus.native.resources.includes so that it can be loaded in native mode.

2.52.4. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.jasypt.enabled

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.

boolean

true

quarkus.camel.jasypt.algorithm

The algorithm to be used for decryption.

string

PBEWithMD5AndDES

quarkus.camel.jasypt.password

The master password used by Jasypt for decrypting configuration values. This option supports prefixes which influence the master password lookup behaviour.

sys: will to look up the value from a JVM system property. sysenv: will look up the value from the OS system environment with the given key.

string

 

quarkus.camel.jasypt.random-iv-generator-algorithm

Configures the Jasypt StandardPBEStringEncryptor with a RandomIvGenerator using the given algorithm.

string

SHA1PRNG

quarkus.camel.jasypt.random-salt-generator-algorithm

Configures the Jasypt StandardPBEStringEncryptor with a RandomSaltGenerator using the given algorithm.

string

SHA1PRNG

quarkus.camel.jasypt.configuration-customizer-class-name

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.

string

 

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.53. Java jOOR DSL

Support for parsing Java route definitions at runtime

2.53.1. What’s inside

Refer to the above link for usage and configuration details.

2.53.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-java-joor-dsl</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.53.3. Camel Quarkus limitations

The annotations added to the classes to be compiled by the component are ignored by Quarkus. The only annotation that is partially supported by the extension is the annotation RegisterForReflection to ease the configuration of the reflection for the native mode however, note that the element registerFullHierarchy is not supported.

2.54. JAXB

Unmarshal XML payloads to POJOs and back using JAXB2 XML marshalling standard.

2.54.1. What’s inside

Refer to the above link for usage and configuration details.

2.54.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jaxb</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.54.3. Usage

When performing JAXB marshal operations with a custom ObjectFactory to instantiate POJO classes that do not have JAXB annotations, you must register those POJO classes for reflection in order for them to be instantiated in native mode. E.g via the @RegisterForReflection annotation or configuration property quarkus.camel.native.reflection.include-patterns.

Refer to the Native mode user guide for more information.

2.55. JDBC

Access databases through SQL and JDBC.

2.55.1. What’s inside

Refer to the above link for usage and configuration details.

2.55.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jdbc</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.55.3. Additional Camel Quarkus configuration

2.55.3.1. Configuring a DataSource

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
Copy to Clipboard Toggle word wrap

If you choose to not name the datasource, you can resolve the default DataSource by defining your endpoint like to("jdbc:default").

In dev and test mode you can take advantage of Configuration Free Databases. All you need to do is reference the default database in your routes. E.g to("jdbc:default").

2.56. Jira

Interact with JIRA issue tracker.

2.56.1. What’s inside

Refer to the above link for usage and configuration details.

2.56.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jira</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.56.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.57. JMS

Sent and receive messages to/from a JMS Queue or Topic.

2.57.1. What’s inside

Refer to the above link for usage and configuration details.

2.57.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jms</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.57.3. Usage

2.57.3.1. Message mapping with org.w3c.dom.Node

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.

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.

Note

Connection pooling is a Technical Preview feature in this release of {project-name}.

To use connection pooling in the camel-quarkus-jms components, you must add io.quarkiverse.artemis:quarkus-artemis and io.quarkiverse.messaginghub:quarkus-pooled-jms to your pom.xml and set the following configuration:

quarkus.pooled-jms.max-connections = 8
Copy to Clipboard Toggle word wrap

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>
Copy to Clipboard Toggle word wrap

Pooling is enabled by default.

Note

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>
Copy to Clipboard Toggle word wrap

and add the following configuration to your application.properties:

quarkus.pooled-jms.transaction=xa
quarkus.transaction-manager.enable-recovery=true
Copy to Clipboard Toggle word wrap

XA support is only available with quarkus-artemis-jms and ibmmq-client. Also We highly recommend to enable transaction recovery.

Since there is no quarkus extension for ibmmq-client currently, you need to create a custom ConnectionFactory and wrap it by yourself. Here is an example:

@Produces
public ConnectionFactory createXAConnectionFactory(PooledJmsWrapper wrapper) {
    MQXAConnectionFactory mq = new MQXAConnectionFactory();
    try {
        mq.setHostName(ConfigProvider.getConfig().getValue("ibm.mq.host", String.class));
        mq.setPort(ConfigProvider.getConfig().getValue("ibm.mq.port", Integer.class));
        mq.setChannel(ConfigProvider.getConfig().getValue("ibm.mq.channel", String.class));
        mq.setQueueManager(ConfigProvider.getConfig().getValue("ibm.mq.queueManagerName", String.class));
        mq.setTransportType(WMQConstants.WMQ_CM_CLIENT);
        mq.setStringProperty(WMQConstants.USERID,
            ConfigProvider.getConfig().getValue("ibm.mq.user", String.class));
        mq.setStringProperty(WMQConstants.PASSWORD,
            ConfigProvider.getConfig().getValue("ibm.mq.password", String.class));
    } catch (Exception e) {
        throw new RuntimeException("Unable to create new IBM MQ connection factory", e);
    }
    return wrapper.wrapConnectionFactory(mq);
}
Copy to Clipboard Toggle word wrap
Note

If you use ibmmq-client to consume messages and enable XA, you need to configure TransactionManager in the camel route like this:

@Inject
TransactionManager transactionManager;

@Override
public void configure() throws Exception {
    from("jms:queue:DEV.QUEUE.XA?transactionManager=#jtaTransactionManager");
}

@Named("jtaTransactionManager")
public PlatformTransactionManager getTransactionManager() {
    return new JtaTransactionManager(transactionManager);
}
Copy to Clipboard Toggle word wrap

Otherwise, you will get an exception like MQRC_SYNCPOINT_NOT_AVAILABLE.

Note

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'.
Copy to Clipboard Toggle word wrap
it may be ignored and can be assumed that MQ has discarded the transaction's work. Refer to https://access.redhat.com/solutions/1250743[Red Hat Knowledgebase] for more information.
Copy to Clipboard Toggle word wrap

2.57.4. transferException option in native mode

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)
Copy to Clipboard Toggle word wrap

2.58. JPA

Store and retrieve Java objects from databases using Java Persistence API (JPA).

2.58.1. What’s inside

Refer to the above link for usage and configuration details.

2.58.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jpa</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.58.3. Additional Camel Quarkus configuration

The extension leverages Quarkus Hibernate ORM to provide the JPA implementation via Hibernate.

Refer to the Quarkus Hibernate ORM documentation to see how to configure Hibernate and your datasource.

Also, it leverages Quarkus TX API to provide TransactionStrategy implementation.

When a single persistence unit is used, the Camel Quarkus JPA extension will automatically configure the JPA component with a EntityManagerFactory and TransactionStrategy.

2.58.3.1. Configuring JpaMessageIdRepository

It needs to use EntityManagerFactory and TransactionStrategy from the CDI container to configure the JpaMessageIdRepository:

@Inject
EntityManagerFactory entityManagerFactory;

@Inject
TransactionStrategy transactionStrategy;

from("direct:idempotent")
    .idempotentConsumer(
        header("messageId"),
        new JpaMessageIdRepository(entityManagerFactory, transactionStrategy, "idempotentProcessor"));
Copy to Clipboard Toggle word wrap
Note

Since it excludes the spring-orm dependency, some options such as sharedEntityManager, transactionManager are not supported.

2.59. JSLT

Query or transform JSON payloads using an JSLT.

2.59.1. What’s inside

Refer to the above link for usage and configuration details.

2.59.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jslt</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.59.3. allowContextMapAll option in native mode

The allowContextMapAll option is not supported in native mode as it requires reflective access to security sensitive camel core classes such as CamelContext & Exchange. This is considered a security risk and thus access to the feature is not provided by default.

2.59.4. Additional Camel Quarkus configuration

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");
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.

2.59.4.2. Using JSLT functions in native mode

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.

@RegisterForReflection
public class MathFunctionStub {
    public static double pow(double a, double b) {
        return java.lang.Math.pow(a, b);
    }
}
Copy to Clipboard Toggle word wrap

The target function Math.pow(…​) is now accessible through the MathFunctionStub class that could be registered in the component as below:

@Named
JsltComponent jsltWithFunction() throws ClassNotFoundException {
    JsltComponent component = new JsltComponent();
    component.setFunctions(singleton(wrapStaticMethod("power", "org.apache.cq.example.MathFunctionStub", "pow")));
    return component;
}
Copy to Clipboard Toggle word wrap

2.60. JSON Path

Evaluate a JSONPath expression against a JSON message body

2.60.1. What’s inside

Refer to the above link for usage and configuration details.

2.60.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jsonpath</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.61. JTA

Enclose Camel routes in transactions using Java Transaction API (JTA) and Narayana transaction manager

2.61.1. What’s inside

Refer to the above link for usage and configuration details.

2.61.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jta</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.61.3. Usage

This extension should be added when you need to use the transacted() EIP in the router. It leverages the transaction capabilities provided by the narayana-jta extension in Quarkus.

Refer to the Quarkus Transaction guide for the more details about transaction support. For a simple usage:

from("direct:transaction")
    .transacted()
    .to("sql:INSERT INTO A TABLE ...?dataSource=#ds1")
    .to("sql:INSERT INTO A TABLE ...?dataSource=#ds2")
    .log("all data are in the ds1 and ds2")
Copy to Clipboard Toggle word wrap

Support is provided for various transaction policies.

Expand
PolicyDescription

PROPAGATION_MANDATORY

Support a current transaction; throw an exception if no current transaction exists.

PROPAGATION_NEVER

Do not support a current transaction; throw an exception if a current transaction exists.

PROPAGATION_NOT_SUPPORTED

Do not support a current transaction; rather always execute non-transactionally.

PROPAGATION_REQUIRED

Support a current transaction; create a new one if none exists.

PROPAGATION_REQUIRES_NEW

Create a new transaction, suspending the current transaction if one exists.

PROPAGATION_SUPPORTS

Support a current transaction; execute non-transactionally if none exists.

2.62. 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.

2.62.1. What’s inside

  • JT400 component, URI syntax: jt400:userID:password@systemName/QSYS.LIB/objectPath.type

Refer to the above link for usage and configuration details.

2.62.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jt400</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.63. JQ

Evaluates a JQ expression against a JSON message body.

2.63.1. What’s inside

Refer to the above link for usage and configuration details.

2.63.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jq</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.63.3. Usage

If you choose to perform JQ transformations that specify the result class as some custom type in native mode, then you must register that type for reflection.

E.g via the @RegisterForReflection annotation or configuration property quarkus.camel.native.reflection.include-patterns. For example:

@RegisterForReflection
public class Book {
    ...
}
Copy to Clipboard Toggle word wrap
public class MyJQRoutes extends RouteBuilder {
    @Override
    public void configure() {
        from("direct:jq")
            .transform().jq(".book", Book.class);
    }
}
Copy to Clipboard Toggle word wrap

Refer to the Native mode user guide for more information.

2.64. Kafka

Sent and receive messages to/from an Apache Kafka broker.

2.64.1. What’s inside

Refer to the above link for usage and configuration details.

2.64.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-kafka</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.64.3. Usage

2.64.3.1. Quarkus Kafka Dev Services

Camel Quarkus Kafka can take advantage of Quarkus Kafka Dev services to simplify development and testing with a local containerized Kafka broker.

Kafka Dev Services is enabled by default in dev & test mode. The Camel Kafka component is automatically configured so that the brokers component option is set to point at the local containerized Kafka broker. Meaning that there’s no need to configure this option yourself.

This functionality can be disabled with the configuration property quarkus.kafka.devservices.enabled=false.

2.64.4. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.kafka.kubernetes-service-binding.merge-configuration

If true then any Kafka configuration properties discovered by the Quarkus Kubernetes Service Binding extension (if configured) will be merged with those set via Camel Kafka component or endpoint options. If false then any Kafka configuration properties discovered by the Quarkus Kubernetes Service Binding extension are ignored, and all of the Kafka component configuration is driven by Camel.

boolean

true

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.65. Kamelet

Materialize route templates

2.65.1. What’s inside

Refer to the above link for usage and configuration details.

2.65.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-kamelet</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.65.3. Usage

2.65.3.1. Using the Kamelet Catalog

A set of pre-made Kamelets can be found in the Kamelet Catalog. To use a Kamelet from the catalog, you need to copy its YAML definition (that you can find in the camel-kamelets repository) to your project.

Alternatively, you can add the camel-kamelets dependency to your application.

<dependency>
    <groupId>org.apache.camel.kamelets</groupId>
    <artifactId>camel-kamelets</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

If the Kamelet requires the camel-kamelets-utils dependency, then this should also be added to your application.

<dependency>
    <groupId>org.apache.camel.kamelets</groupId>
    <artifactId>camel-kamelets-utils</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.apache.camel</groupId>
            <artifactId>*</artifactId>
        </exclusion>
    </exclusions>
</dependency>
Copy to Clipboard Toggle word wrap

2.66. Kubernetes

Perform operations against Kubernetes API

2.66.1. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-kubernetes</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.66.2. Additional Camel Quarkus configuration

Important

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.

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")
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

The full set of configuration options are documented in the Quarkus Kubernetes Client guide.

2.67. Kubernetes Cluster Service

Provides a Kubernetes implementation of the Camel Cluster Service SPI

2.67.1. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-kubernetes-cluster-service</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.67.2. Additional Camel Quarkus configuration

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");
Copy to Clipboard Toggle word wrap

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.

Expand
Configuration propertyTypeDefault

quarkus.camel.cluster.kubernetes.enabled

Whether a Kubernetes Cluster Service should be automatically configured according to 'quarkus.camel.cluster.kubernetes.*' configurations.

boolean

true

quarkus.camel.cluster.kubernetes.rebalancing

Whether the camel master namespace leaders should be distributed evenly across all the camel contexts in the cluster.

boolean

true

quarkus.camel.cluster.kubernetes.id

The cluster service ID (defaults to null).

string

 

quarkus.camel.cluster.kubernetes.master-url

The URL of the Kubernetes master (read from Kubernetes client properties by default).

string

 

quarkus.camel.cluster.kubernetes.connection-timeout-millis

The connection timeout in milliseconds to use when making requests to the Kubernetes API server.

int

 

quarkus.camel.cluster.kubernetes.namespace

The name of the Kubernetes namespace containing the pods and the configmap (autodetected by default).

string

 

quarkus.camel.cluster.kubernetes.pod-name

The name of the current pod (autodetected from container host name by default).

string

 

quarkus.camel.cluster.kubernetes.jitter-factor

The jitter factor to apply in order to prevent all pods to call Kubernetes APIs in the same instant (defaults to 1.2).

double

 

quarkus.camel.cluster.kubernetes.lease-duration-millis

The default duration of the lease for the current leader (defaults to 15000).

long

 

quarkus.camel.cluster.kubernetes.renew-deadline-millis

The deadline after which the leader must stop its services because it may have lost the leadership (defaults to 10000).

long

 

quarkus.camel.cluster.kubernetes.retry-period-millis

The time between two subsequent attempts to check and acquire the leadership. It is randomized using the jitter factor (defaults to 2000).

long

 

quarkus.camel.cluster.kubernetes.order

Service lookup order/priority (defaults to 2147482647).

int

 

quarkus.camel.cluster.kubernetes.resource-name

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.

string

 

quarkus.camel.cluster.kubernetes.lease-resource-type

The lease resource type used in Kubernetes, either 'config-map' or 'lease' (defaults to 'lease').

config-map, lease

 

[[quarkus-camel-cluster-kubernetes-labels—​labels]] quarkus.camel.cluster.kubernetes.labels."labels"

The labels key/value used to identify the pods composing the cluster, defaults to empty map.

Map<String,String>

 

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.68. Kudu

Interact with Apache Kudu, a free and open source column-oriented data store of the Apache Hadoop ecosystem.

2.68.1. What’s inside

Refer to the above link for usage and configuration details.

2.68.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-kudu</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.68.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.69. Language

Execute scripts in any of the languages supported by Camel.

2.69.1. What’s inside

Refer to the above link for usage and configuration details.

2.69.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-language</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.69.3. Usage

2.69.3.1. Required Dependencies

The Language extension only handles the passing of an Exchange to a script for execution. The extension implementing the language must be added as a dependency. The following list of languages are implemented in Core:

  • Constant
  • ExchangeProperty
  • File
  • Header
  • Ref
  • Simple
  • Tokenize

To use any other language, you must add the corresponding dependency. Consult the Languages Guide for details.

2.69.3.2. Native Mode

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
Copy to Clipboard Toggle word wrap

2.69.4. allowContextMapAll option in native mode

The allowContextMapAll option is not supported in native mode as it requires reflective access to security sensitive camel core classes such as CamelContext & Exchange. This is considered a security risk and thus access to the feature is not provided by default.

2.70. LDAP

Perform searches on LDAP servers.

2.70.1. What’s inside

Refer to the above link for usage and configuration details.

2.70.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-ldap</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.70.3. Usage

2.70.3.1. Using SSL in Native Mode

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.
}
Copy to Clipboard Toggle word wrap

2.71. LRA

Camel saga binding for Long-Running-Action framework

2.71.1. What’s inside

Refer to the above link for usage and configuration details.

2.71.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-lra</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.72. Log

Prints data form the routed message (such as body and headers) to the logger.

2.72.1. What’s inside

Refer to the above link for usage and configuration details.

2.72.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-log</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.73. Mail

Send and receive emails using imap, pop3 and smtp protocols. Marshal Camel messages with attachments into MIME-Multipart messages and back.

2.73.1. What’s inside

Refer to the above links for usage and configuration details.

2.73.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-mail</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.74. Management

JMX management strategy and associated managed resources.

2.74.1. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-management</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.74.2. Usage

For information on using Managed Beans in Camel, consult the JMX section of the Camel Manual.

2.74.2.1. Enabling and Disabling JMX

JMX can be enabled or disabled in Camel-Quarkus by any of the following methods:

  1. Adding or removing the camel-quarkus-management extension.
  2. Setting the camel.main.jmxEnabled configuration property to a boolean value.
  3. Setting the system property -Dorg.apache.camel.jmx.disabled to a boolean value.
2.74.2.2. Native mode

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
Copy to Clipboard Toggle word wrap

If you want the native application to be discoverable by tools such as JConsole and VisualVM, append the jvmstat option to the above mentioned configuration.

For more information, refer to the Quarkus native guide.

2.75. MapStruct

Type Conversion using Mapstruct

2.75.1. What’s inside

Refer to the above link for usage and configuration details.

2.75.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-mapstruct</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.75.3. Usage

2.75.3.1. Annotation Processor

To use MapStruct, you must configure your build to use an annotation processor.

2.75.3.1.1. Maven
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <annotationProcessorPaths>
                <path>
                    <groupId>org.mapstruct</groupId>
                    <artifactId>mapstruct-processor</artifactId>
                    <version>{mapstruct-version}</version>
                </path>
            </annotationProcessorPaths>
        </configuration>
    </plugin>
</plugins>
Copy to Clipboard Toggle word wrap
2.75.3.1.2. Gradle
dependencies {
    annotationProcessor 'org.mapstruct:mapstruct-processor:{mapstruct-version}'
    testAnnotationProcessor 'org.mapstruct:mapstruct-processor:{mapstruct-version}'
}
Copy to Clipboard Toggle word wrap
2.75.3.2. Mapper definition discovery

By default, {project-name} will automatically discover the package paths of your @Mapper annotated interfaces or abstract classes and pass them to the Camel MapStruct component.

If you want finer control over the specific packages that are scanned, then you can set a configuration property in application.properties.

camel.component.mapstruct.mapper-package-name = com.first.package,org.second.package
Copy to Clipboard Toggle word wrap

2.76. Master

Have only a single consumer in a cluster consuming from a given endpoint; with automatic failover if the JVM dies.

2.76.1. What’s inside

Refer to the above link for usage and configuration details.

2.76.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-master</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.76.3. Additional Camel Quarkus configuration

This extension can be used in conjunction with extensions below:

2.77. Micrometer

Collect various metrics directly from Camel routes using the Micrometer library.

2.77.1. What’s inside

Refer to the above link for usage and configuration details.

2.77.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-micrometer</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.77.3. Usage

This extension leverages Quarkus Micrometer. Quarkus supports a variety of Micrometer metric registry implementations.

Your application should declare the following dependency or one of the dependencies listed in the quarkiverse documentation, depending on the monitoring solution you want to work with.

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-micrometer-registry-prometheus</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

If no dependency is declared, the Micrometer extension creates a SimpleMeterRegistry instance, suitable mainly for testing.

2.77.4. Camel Quarkus limitations

2.77.4.1. Exposing Micrometer statistics in JMX

Exposing Micrometer statistics in JMX is not available in native mode as quarkus-micrometer-registry-jmx does not have native support at present.

Prometheus backend ignores negative values during increment of Counter metrics.

2.77.4.3. Exposing statistics in JMX

In {project-name}, registering a JmxMeterRegistry is simplified. Add a dependency for io.quarkiverse.micrometer.registry:quarkus-micrometer-registry-jmx and a JmxMeterRegistry will automatically get created for you.

2.77.5. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.metrics.enable-route-policy

Set whether to enable the MicrometerRoutePolicyFactory for capturing metrics on route processing times.

boolean

true

quarkus.camel.metrics.enable-message-history

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.

boolean

false

quarkus.camel.metrics.enable-exchange-event-notifier

Set whether to enable the MicrometerExchangeEventNotifier for capturing metrics on exchange processing times.

boolean

true

quarkus.camel.metrics.enable-route-event-notifier

Set whether to enable the MicrometerRouteEventNotifier for capturing metrics on the total number of routes and total number of routes running.

boolean

true

quarkus.camel.metrics.enable-instrumented-thread-pool-factory

Set whether to gather performance information about Camel Thread Pools by injecting an InstrumentedThreadPoolFactory.

boolean

false

quarkus.camel.metrics.naming-strategy

Controls the naming style to use for metrics. The available values are default and legacy. default uses the default Micrometer naming convention. legacy uses the legacy camel-case naming style.

default, legacy

default

quarkus.camel.metrics.route-policy-level

Sets the level of metrics to capture. The available values are all ,context and route. all captures metrics for both the camel context and routes. route captures metrics for routes only. context captures metrics for the camel context only.

all, context, route

all

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.78. Microprofile Fault Tolerance

Circuit Breaker EIP using Microprofile Fault Tolerance

2.78.1. What’s inside

Refer to the above link for usage and configuration details.

2.78.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.79. MicroProfile Health

Expose Camel health checks via MicroProfile Health

2.79.1. What’s inside

Refer to the above link for usage and configuration details.

2.79.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-microprofile-health</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.79.3. Usage

You can register health checks for your applications with the Camel health check API.

By default, classes extending AbstractHealthCheck are registered as both liveness and readiness checks. You can override the isReadiness method to control this behaviour.

Any checks provided by your application are automatically discovered and bound to the Camel registry. They will be available via the Quarkus health endpoints /q/health/live and /q/health/ready.

You can also provide custom HealthCheckRepository implementations and these are also automatically discovered and bound to the Camel registry for you.

Refer to the Quarkus health guide for further information.

2.79.3.1. Provided health checks

Some checks are automatically registered for your application.

2.79.3.1.1. Camel Context Health

Inspects the Camel Context status and causes the health check status to be DOWN if the status is anything other than 'Started'.

2.79.3.1.2. Camel Route Health

Inspects the status of each route and causes the health check status to be DOWN if any route status is not 'Started'.

2.79.4. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.health.enabled

Set whether to enable Camel health checks

boolean

true

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.80. Minio

Store and retrieve objects from Minio Storage Service using Minio SDK.

2.80.1. What’s inside

Refer to the above link for usage and configuration details.

2.80.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-minio</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.80.3. Additional Camel Quarkus configuration

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
Copy to Clipboard Toggle word wrap

2.81. MLLP

Communicate with external systems using the MLLP protocol.

2.81.1. What’s inside

Refer to the above link for usage and configuration details.

2.81.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-mllp</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.81.3. Additional Camel Quarkus configuration

2.82. Mock

Test routes and mediation rules using mocks.

2.82.1. What’s inside

Refer to the above link for usage and configuration details.

2.82.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-mock</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.82.3. Usage

To use camel-mock capabilities in tests it is required to get access to MockEndpoint instances.

CDI injection could be used for accessing instances (see Quarkus documentation). You can inject camelContext into test using @Inject annotation. Camel context can be then used for obtaining mock endpoints. See the following example:

import jakarta.inject.Inject;

import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
public class MockJvmTest {

    @Inject
    CamelContext camelContext;

    @Inject
    ProducerTemplate producerTemplate;

    @Test
    public void test() throws InterruptedException {

        producerTemplate.sendBody("direct:start", "Hello World");

        MockEndpoint mockEndpoint = camelContext.getEndpoint("mock:result", MockEndpoint.class);
        mockEndpoint.expectedBodiesReceived("Hello World");

        mockEndpoint.assertIsSatisfied();
    }
}
Copy to Clipboard Toggle word wrap

Route used for the example test:

import jakarta.enterprise.context.ApplicationScoped;

import org.apache.camel.builder.RouteBuilder;

@ApplicationScoped
public class MockRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        from("direct:start").to("mock:result");
    }
}
Copy to Clipboard Toggle word wrap

2.82.4. Camel Quarkus limitations

Injection of CDI beans (described in Usage) does not work in native mode.

In the native mode the test and the application under test are running in two different processes and it is not possible to share a mock bean between them (see Quarkus documentation).

2.83. MongoDB

Perform operations on MongoDB documents and collections.

2.83.1. What’s inside

Refer to the above link for usage and configuration details.

2.83.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-mongodb</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.83.3. Additional Camel Quarkus configuration

The extension leverages the Quarkus MongoDB Client extension. The Mongo client can be configured via the Quarkus MongoDB Client configuration options.

The Camel Quarkus MongoDB extension automatically registers a MongoDB client bean named camelMongoClient. This can be referenced in the mongodb endpoint URI connectionBean path parameter. For example:

from("direct:start")
.to("mongodb:camelMongoClient?database=myDb&collection=myCollection&operation=findAll")
Copy to Clipboard Toggle word wrap

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/
Copy to Clipboard Toggle word wrap
//Routes.java

    @ApplicationScoped
    public class Routes extends RouteBuilder {
        @Inject
        @MongoClientName("mongoClient1")
        MongoClient mongoClient1;

        @Override
        public void configure() throws Exception {
            from("direct:defaultServer")
                .to("mongodb:camelMongoClient?database=myDb&collection=myCollection&operation=findAll")

            from("direct:otherServer")
                .to("mongodb:mongoClient1?database=myOtherDb&collection=myOtherCollection&operation=findAll");
        }
    }
Copy to Clipboard Toggle word wrap

Note that when using named clients, the "default" camelMongoClient bean will still be produced. Refer to the Quarkus documentation on Multiple MongoDB Clients for more information.

2.84. MyBatis

Performs a query, poll, insert, update or delete in a relational database using MyBatis.

2.84.1. What’s inside

Refer to the above links for usage and configuration details.

2.84.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-mybatis</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.84.3. Additional Camel Quarkus configuration

Refer to Quarkus MyBatis for configuration. It must enable the following options

quarkus.mybatis.xmlconfig.enable=true
quarkus.mybatis.xmlconfig.path=SqlMapConfig.xml
Copy to Clipboard Toggle word wrap
Tip

quarkus.mybatis.xmlconfig.path must be the same with configurationUri param in the mybatis endpoint.

2.85. Netty HTTP

The Netty HTTP extension provides HTTP transport on top of the Netty extension.

2.85.1. What’s inside

Refer to the above link for usage and configuration details.

2.85.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-netty-http</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.85.3. transferException option in native mode

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)
Copy to Clipboard Toggle word wrap

2.85.4. Additional Camel Quarkus configuration

  • Check the Character encodings section of the Native mode guide if you expect your application to send or receive requests using non-default encodings.

2.86. Netty

Socket level networking using TCP or UDP with Netty 4.x.

2.86.1. What’s inside

Refer to the above link for usage and configuration details.

2.86.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-netty</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.87. OpenAPI Java

Expose OpenAPI resources defined in Camel REST DSL

2.87.1. What’s inside

Refer to the above link for usage and configuration details.

2.87.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-openapi-java</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.87.3. Usage

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
Copy to Clipboard Toggle word wrap
Warning

It’s the user’s responsibility to use @RegisterForReflection to register all model classes for reflection.

It doesn’t support the rest services used in org.apache.camel.builder.LambdaRouteBuilder right now. Also, it can not use CDI injection in the RouteBuilder configure() since we get the rest definitions at build time while CDI is unavailable.

2.87.4. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.openapi.expose.enabled

Expose the Camel REST DSL services to quarkus openapi at build time if 'quarkus.smallrye-openapi' is available.

boolean

false

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.88. OpenTelemetry

Distributed tracing using OpenTelemetry

2.88.1. What’s inside

Refer to the above link for usage and configuration details.

2.88.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-opentelemetry</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.88.3. Usage

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
Copy to Clipboard Toggle word wrap

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:*
Copy to Clipboard Toggle word wrap
2.88.3.1. Exporters

Quarkus OpenTelemetry defaults to the standard OTLP exporter defined in OpenTelemetry. Additional exporters will be available in the Quarkiverse quarkus-opentelemetry-exporter project.

2.88.3.2. Tracing CDI bean method execution

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.

@ApplicationScoped
@Named("myBean")
public class MyBean {
    @WithSpan
    public String greet() {
        return "Hello World!";
    }
}
Copy to Clipboard Toggle word wrap

Next, use the bean in your Camel route.

Important

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.

public class MyRoutes extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        from("direct:executeBean")
                .to("bean:myBean?method=greet");
    }
}
Copy to Clipboard Toggle word wrap

There is more information about CDI instrumentation in the Quarkus OpenTelemetry guide.

2.88.4. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.opentelemetry.encoding

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.

boolean

false

quarkus.camel.opentelemetry.exclude-patterns

Sets whether to disable tracing for endpoint URIs or Processor ids that match the given comma separated patterns. The pattern can take the following forms:

1. An exact match on the endpoint URI. E.g platform-http:/some/path

2. A wildcard match. E.g platform-http:*

3. A regular expression matching the endpoint URI. E.g platform-http:/prefix/.*

string

 

quarkus.camel.opentelemetry.trace-processors

Sets whether to create new OpenTelemetry spans for each Camel Processor. Use the excludePatterns property to filter out Processors.

boolean

false

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.89. Paho MQTT5

Communicate with MQTT message brokers using Eclipse Paho MQTT v5 Client.

2.89.1. What’s inside

Refer to the above link for usage and configuration details.

2.89.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-paho-mqtt5</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.90. Paho

Communicate with MQTT message brokers using Eclipse Paho MQTT Client.

2.90.1. What’s inside

Refer to the above link for usage and configuration details.

2.90.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-paho</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.91. Platform HTTP

This extension allows for creating HTTP endpoints for consuming HTTP requests.

It is built on top of the Eclipse Vert.x HTTP server provided by the quarkus-vertx-http extension.

2.91.1. What’s inside

Refer to the above link for usage and configuration details.

2.91.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-platform-http</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.91.3. Usage

2.91.3.1. Basic Usage

Serve all HTTP methods on the /hello endpoint:

from("platform-http:/hello").setBody(simple("Hello ${header.name}"));
Copy to Clipboard Toggle word wrap

Serve only GET requests on the /hello endpoint:

from("platform-http:/hello?httpMethodRestrict=GET").setBody(simple("Hello ${header.name}"));
Copy to Clipboard Toggle word wrap
2.91.3.2. Using platform-http via Camel REST DSL

To be able to use Camel REST DSL with the platform-http component, add camel-quarkus-rest to your pom.xml:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-rest</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

Then you can use the Camel REST DSL:

rest()
    .get("/my-get-endpoint")
        .to("direct:handleGetRequest");

    .post("/my-post-endpoint")
        .to("direct:handlePostRequest");
Copy to Clipboard Toggle word wrap

You can restrict the uploads to certain file extensions by white listing them:

from("platform-http:/upload/multipart?fileNameExtWhitelist=adoc,txt&httpMethodRestrict=POST")
    .to("log:multipart")
    .process(e -> {
        final AttachmentMessage am = e.getMessage(AttachmentMessage.class);
        if (am.hasAttachments()) {
            am.getAttachments().forEach((fileName, dataHandler) -> {
                try (InputStream in = dataHandler.getInputStream()) {
                    // do something with the input stream
                } catch (IOException ioe) {
                    throw new RuntimeException(ioe);
                }
            });
        }
    });
Copy to Clipboard Toggle word wrap
2.91.3.4. Securing platform-http endpoints

Quarkus provides a variety of security and authentication mechanisms which can be used to secure platform-http endpoints. Refer to the Quarkus Security documentation for further details.

Within a route, it is possible to obtain the authenticated user and its associated SecurityIdentity and Principal:

from("platform-http:/secure")
    .process(e -> {
        Message message = e.getMessage();
        QuarkusHttpUser user = message.getHeader(VertxPlatformHttpConstants.AUTHENTICATED_USER, QuarkusHttpUser.class);
        SecurityIdentity securityIdentity = user.getSecurityIdentity();
        Principal principal = securityIdentity.getPrincipal();
        // Do something useful with SecurityIdentity / Principal. E.g check user roles etc.
    });
Copy to Clipboard Toggle word wrap

Also check the quarkus.http.body.* configuration options in Quarkus documentation, esp. quarkus.http.body.handle-file-uploads, quarkus.http.body.uploads-directory and quarkus.http.body.delete-uploaded-files-on-end.

2.91.3.5. Implementing a reverse proxy

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 + "}");
Copy to Clipboard Toggle word wrap
2.91.3.6. Error handling

If you need to customize the reponse returned to the client when exceptions are thrown from your routes, then you can use Camel error handling constucts like doTry, doCatch and onException.

For example, to configure a global exception handler in response to a specific Exception type being thrown.

onException(InvalidOrderTotalException.class)
    .handled(true)
    .setHeader(Exchange.HTTP_RESPONSE_CODE).constant(500)
    .setHeader(Exchange.CONTENT_TYPE).constant("text/plain")
    .setBody().constant("The order total was not greater than 100");

from("platform-http:/orders")
    .choice().when().xpath("//order/total > 100")
        .to("direct:processOrder")
    .otherwise()
        .throwException(new InvalidOrderTotalException());
Copy to Clipboard Toggle word wrap

You can implement more fine-grained error handling by hooking into the Vert.x Web router initialization with a CDI observer.

void initRouter(@Observes Router router) {
    // Custom 404 handler
    router.errorHandler(404, new Handler<RoutingContext>() {
        @Override
        public void handle(RoutingContext event) {
            event.response()
                .setStatusCode(404)
                .putHeader("Content-Type", "text/plain")
                .end("Sorry - resource not found");
        }
    });
}
Copy to Clipboard Toggle word wrap

Note that care should be taken when modifying the router configuration when extensions such as RestEASY are present, since they may register their own error handling logic.

2.91.4. Additional Camel Quarkus configuration

2.91.4.1. Platform HTTP server configuration

Configuration of the platform HTTP server is managed by Quarkus. Refer to the Quarkus HTTP configuration guide for the full list of configuration options.

To configure SSL for the Platform HTTP server, follow the secure connections with SSL guide. Note that configuring the server for SSL with SSLContextParameters is not currently supported.

2.91.4.2. Character encodings

Check the Character encodings section of the Native mode guide if you expect your application to send or receive requests using non-default encodings.

2.92. Quartz

Schedule sending of messages using the Quartz 2.x scheduler.

2.92.1. What’s inside

Refer to the above link for usage and configuration details.

2.92.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-quartz</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.92.3. Usage

2.92.3.1. Clustering

Support for Quartz clustering is provided by the Quarkus Quartz extension. The following steps outline how to configure Quarkus Quartz for use with Camel.

  1. Enable Quartz clustered mode and configure a DataSource as a persistence Quartz job store. An example configuration is as follows.

    # Quartz configuration
    quarkus.quartz.clustered=true
    quarkus.quartz.store-type=jdbc-cmt
    quarkus.scheduler.start-mode=forced
    
    # Datasource configuration
    quarkus.datasource.db-kind=postgresql
    quarkus.datasource.username=quarkus_test
    quarkus.datasource.password=quarkus_test
    quarkus.datasource.jdbc.url=jdbc:postgresql://localhost/quarkus_test
    
    # Optional automatic creation of Quartz tables
    quarkus.flyway.connect-retries=10
    quarkus.flyway.table=flyway_quarkus_history
    quarkus.flyway.migrate-at-start=true
    quarkus.flyway.baseline-on-migrate=true
    quarkus.flyway.baseline-version=1.0
    quarkus.flyway.baseline-description=Quartz
    Copy to Clipboard Toggle word wrap
  2. Add the correct JDBC driver extension to your application that corresponds to the value of quarkus.datasource.db-kind. In the above example postgresql is used, therefore the following JDBC dependency would be required. Adjust as necessary for your needs. Agroal is also required for DataSource support.

    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-jdbc-postgresql</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-agroal</artifactId>
    </dependency>
    Copy to Clipboard Toggle word wrap
  3. Quarkus Flyway can automatically create the necessary Quartz database tables for you. Add quarkus-flyway to your application (optional).

    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-flyway</artifactId>
    </dependency>
    Copy to Clipboard Toggle word wrap

    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.

  4. Configure the Camel Quartz component to use the Quarkus Quartz scheduler.

    @Produces
    @Singleton
    @Named("quartz")
    public QuartzComponent quartzComponent(Scheduler scheduler) {
        QuartzComponent component = new QuartzComponent();
        component.setScheduler(scheduler);
        return component;
    }
    Copy to Clipboard Toggle word wrap

Further customization of the Quartz scheduler can be done via various configuration properties. Refer to to the Quarkus Quartz Configuration guide for more information.

2.93. Qute

Transform messages using Quarkus Qute templating engine

2.93.1. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-qute</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.93.2. Usage

For more information about Qute, Refer to the Quarkus Qute documentation.

2.93.3. Camel Quarkus limitations

2.93.4. allowContextMapAll option in native mode

The allowContextMapAll option is not supported in native mode as it requires reflective access to security sensitive camel core classes such as CamelContext & Exchange. This is considered a security risk and thus access to the feature is not provided by default.

2.93.5. Additional Camel Quarkus configuration

By default, all files located in the src/main/resources/templates directory and its subdirectories are registered as templates. Templates are validated during startup and watched for changes in the development mode.

2.94. Ref

Route messages to an endpoint looked up dynamically by name in the Camel Registry.

2.94.1. What’s inside

Refer to the above link for usage and configuration details.

2.94.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-ref</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.94.3. Usage

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:

@ApplicationScoped
public class MyEndpointProducers {
    @Inject
    CamelContext context;

    @Singleton
    @Produces
    @Named("endpoint1")
    public Endpoint directStart() {
        return context.getEndpoint("direct:start");
    }

    @Singleton
    @Produces
    @Named("endpoint2")
    public Endpoint logEnd() {
        return context.getEndpoint("log:end");
    }
}
Copy to Clipboard Toggle word wrap

Use ref: to refer to the names of the CDI beans that were bound to the Camel registry:

public class MyRefRoutes extends RouteBuilder {
    @Override
    public void configure() {
        // direct:start -> log:end
        from("ref:endpoint1")
            .to("ref:endpoint2");
    }
}
Copy to Clipboard Toggle word wrap

2.95. REST OpenApi

To call REST services using OpenAPI specification as contract.

2.95.1. What’s inside

Refer to the above link for usage and configuration details.

2.95.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-rest-openapi</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.95.3. Usage

2.95.3.1. Required Dependencies

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>
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap
2.95.3.2. Contract First Development

The model classes generation has been integrated with the quarkus-maven-plugin. So there’s no need to use the swagger-codegen-maven-plugin, instead put your contract files in src/main/openapi with a .json suffix. And add the generate-code goal to the quarkus-maven-plugin like:

<plugin>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>generate-code</goal>
            </goals>
        </execution>
    </executions>
</plugin>
Copy to Clipboard Toggle word wrap

It requires a specific package name for the model classes by using the quarkus.camel.openapi.codegen.model-package property of the application.properties file. For example:

quarkus.camel.openapi.codegen.model-package=org.acme
Copy to Clipboard Toggle word wrap

This package name should be added in camel.rest.bindingPackageScan as well.

The contract files in src/main/openapi needs to be added in the classpath since they could be used in Camel Rest DSL. So you can add src/main/openapi in pom.xml

<build>
    <resources>
        <resource>
            <directory>src/main/openapi</directory>
        </resource>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
    </resources>
</build>
Copy to Clipboard Toggle word wrap

When running in the native mode, the contract files must be specified the quarkus.native.resources.include like

quarkus.native.resources.includes=contract.json
Copy to Clipboard Toggle word wrap

2.95.4. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.openapi.codegen.enabled

If true, Camel Quarkus OpenAPI code generation is run for .json files discovered from the openapi directory. When false, code generation for .json files is disabled.

boolean

true

quarkus.camel.openapi.codegen.model-package

The package to use for generated model classes.

string

org.apache.camel.quarkus

quarkus.camel.openapi.codegen.models

A comma separated list of models to generate. All models is the default.

string

 

quarkus.camel.openapi.codegen.use-bean-validation

If true, use bean validation annotations in the generated model classes.

boolean

false

quarkus.camel.openapi.codegen.not-null-jackson

If true, use NON_NULL Jackson annotation in the generated model classes.

boolean

false

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.96. Rest

Expose REST services and their OpenAPI Specification or call external REST services.

2.96.1. What’s inside

Refer to the above links for usage and configuration details.

2.96.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-rest</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.96.3. Additional Camel Quarkus configuration

This extension depends on the Platform HTTP extension and configures it as the component that provides the REST transport.

When using the platform-http REST transport, some characters are not allowed within path parameter names. This includes the '-' and '$' characters.

In order to make the below example REST /dashed/param route work correctly, a system property is required io.vertx.web.route.param.extended-pattern=true.

import org.apache.camel.builder.RouteBuilder;

public class CamelRoute extends RouteBuilder {

    @Override
    public void configure() {
        rest("/api")
            // Dash '-' is not allowed by default
            .get("/dashed/param/{my-param}")
            .to("direct:greet")

            // The non-dashed path parameter works by default
            .get("/undashed/param/{myParam}")
            .to("direct:greet");

            from("direct:greet")
                .setBody(constant("Hello World"));
    }
}
Copy to Clipboard Toggle word wrap

There is some more background to this in the Vert.x Web documentation.

To use another REST transport provider, such as netty-http or servlet, you need to add the respective extension as a dependency to your project and set the provider in your RouteBuilder. E.g. for servlet, you’d have to add the org.apache.camel.quarkus:camel-quarkus-servlet dependency and the set the provider as follows:

import org.apache.camel.builder.RouteBuilder;

public class CamelRoute extends RouteBuilder {

    @Override
    public void configure() {
        restConfiguration()
                .component("servlet");
        ...
    }
}
Copy to Clipboard Toggle word wrap

2.97. Salesforce

Communicate with Salesforce using Java DTOs.

2.97.1. What’s inside

Refer to the above link for usage and configuration details.

2.97.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-salesforce</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.97.3. Usage

iinclude::camel-quarkus-extensions/maven-plugin-unsupported.adoc[]

To generate Salesforce DTOs for your project, use the salesforce-maven-plugin. The example code snippet below creates a single DTO for the Account object.

<plugin>
    <groupId>org.apache.camel.maven</groupId>
    <artifactId>camel-salesforce-maven-plugin</artifactId>
    <version>{camel-version}</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <clientId>${env.SALESFORCE_CLIENTID}</clientId>
                <clientSecret>${env.SALESFORCE_CLIENTSECRET}</clientSecret>
                <userName>${env.SALESFORCE_USERNAME}</userName>
                <password>${env.SALESFORCE_PASSWORD}</password>
                <loginUrl>https://login.salesforce.com</loginUrl>
                <packageName>org.apache.camel.quarkus.component.salesforce.generated</packageName>
                <outputDirectory>src/main/java</outputDirectory>
                <includes>
                    <include>Account</include>
                </includes>
            </configuration>
        </execution>
    </executions>
</plugin>
Copy to Clipboard Toggle word wrap

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}");
Copy to Clipboard Toggle word wrap

Class org.foo.TestEvent would need to be registered for reflection.

package org.foo;

import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection
public class TestEvent {
    // Getters / setters etc
}
Copy to Clipboard Toggle word wrap

Refer to the Native mode user guide for more information.

2.97.4. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.98. Saga

Execute custom actions within a route using the Saga EIP.

2.98.1. What’s inside

Refer to the above link for usage and configuration details.

2.98.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-saga</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.99. SAP

Provides SAP Camel Component

2.99.1. Maven coordinates

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-sap</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.99.2. Camel Quarkus limitations

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".
Copy to Clipboard Toggle word wrap

2.100. XQuery

Query and/or transform XML payloads using XQuery and Saxon.

2.100.1. What’s inside

Refer to the above links for usage and configuration details.

2.100.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-saxon</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.100.3. Additional Camel Quarkus configuration

This component is able to load XQuery definitions from classpath. To make it work also in native mode, you need to explicitly embed the queries in the native executable by using the quarkus.native.resources.includes property.

For instance, the two routes below load an XQuery script from two classpath resources named myxquery.txt and another-xquery.txt respectively:

from("direct:start").transform().xquery("resource:classpath:myxquery.txt", String.class);
from("direct:start").to("xquery:another-xquery.txt");
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.

2.101. AWS Secrets Manager

Manage AWS Secrets Manager services using AWS SDK version 2.x.

2.101.1. What’s inside

Refer to the above link for usage and configuration details.

2.101.2. Maven coordinates

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-aws-secrets-manager</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

With Camel 4.8, the camel context reload is not triggered by executing updateSecret via Camel.

If you want to use the AWS Secrets Manager feature Automatic Camel context reloading on secret refresh, you must do one of the following:

  • update the secret via UI,

    or

  • make an API call with operation PutSecretValue.

2.102. Scheduler

Generate messages in specified intervals using java.util.concurrent.ScheduledExecutorService.

2.102.1. What’s inside

Refer to the above link for usage and configuration details.

2.102.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-scheduler</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.103. SEDA

Asynchronously call another endpoint from any Camel Context in the same JVM.

2.103.1. What’s inside

Refer to the above link for usage and configuration details.

2.103.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-seda</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.104. Servlet

Serve HTTP requests by a Servlet.

2.104.1. What’s inside

Refer to the above link for usage and configuration details.

2.104.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-servlet</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.104.3. Usage

2.104.3.1. Configuring CamelHttpTransportServlet
2.104.3.1.1. Minimal configuration

The simplest way to configure CamelHttpTransportServlet is with configuration properties. The most minimal setup requires that you define one or more URL patterns for the Servlet with quarkus.camel.servlet.url-patterns.

For example with configuration like the following.

quarkus.camel.servlet.url-patterns = /*
Copy to Clipboard Toggle word wrap

And a Camel route.

from("servlet://greet")
    .setBody().constant("Hello World");
Copy to Clipboard Toggle word wrap

Produces the message Hello World.

2.104.3.1.2. Advanced configuration

Servlet name

To give a specific name to the Servlet you can use the quarkus.camel.servlet.servlet-name configuration option.

quarkus.camel.servlet.servlet-name = My Custom Name
Copy to Clipboard Toggle word wrap

Servlet class

You may use a custom Servlet class (E.g one that extends CamelHttpTransportServlet) in your Camel routes.

quarkus.camel.servlet.servlet-class = org.acme.MyCustomServlet
Copy to Clipboard Toggle word wrap

Multiple named Servlets

For more advanced use cases you can configure multiple 'named' Servlets.

quarkus.camel.servlet.my-servlet-a.servlet-name = my-custom-a
quarkus.camel.servlet.my-servlet-a.url-patterns = /custom/a/*

quarkus.camel.servlet.my-servlet-b.servlet-name = my-custom-b
quarkus.camel.servlet.my-servlet-b.servlet-class = org.acme.CustomServletB
quarkus.camel.servlet.my-servlet-b.url-patterns = /custom/b/*
Copy to Clipboard Toggle word wrap
from("servlet://greet?servletName=my-custom-a")
    .setBody().constant("Hello World");

from("servlet://goodbye?servletName=my-custom-b")
    .setBody().constant("Goodbye World");
Copy to Clipboard Toggle word wrap

Finer control of Servlet configuration

If you need more control of the Servlet configuration, for example to configure custom init parameters, then you can do this with a custom Servlet class through the jakarta.servlet.annotation.WebServlet annotation options.

import jakarta.servlet.annotation.WebServlet;
import org.apache.camel.component.servlet.CamelHttpTransportServlet;

@WebServlet(
    urlPatterns = {"/*"},
    initParams = {
        @WebInitParam(name = "myParam", value = "myValue")
    }
)
public class MyCustomServlet extends CamelHttpTransportServlet {
}
Copy to Clipboard Toggle word wrap

Or you can configure the CamelHttpTransportServlet using a web-app descriptor placed into src/main/resources/META-INF/web.xml.

<web-app>
  <servlet>
    <servlet-name>CamelServlet</servlet-name>
    <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>CamelServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
</web-app>
Copy to Clipboard Toggle word wrap

2.104.4. transferException option in native mode

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)
Copy to Clipboard Toggle word wrap

2.104.5. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

quarkus.camel.servlet.url-patterns

A comma separated list of path patterns under which the CamelServlet should be accessible. Example path patterns: /*, /services/*

List of string

 

quarkus.camel.servlet.servlet-class

A fully qualified name of a servlet class to serve paths that match url-patterns

string

org.apache.camel.component.servlet.CamelHttpTransportServlet

quarkus.camel.servlet.servlet-name

A servletName as it would be defined in a web.xml file or in the jakarta.servlet.annotation.WebServlet#name() annotation.

string

CamelServlet

quarkus.camel.servlet.load-on-startup

Sets the loadOnStartup priority on the Servlet. A loadOnStartup is a value greater than or equal to zero, indicates to the container the initialization priority of the Servlet. If loadOnStartup is a negative integer, the Servlet is initialized lazily.

int

-1

quarkus.camel.servlet.async

Enables Camel to benefit from asynchronous Servlet support.

boolean

false

quarkus.camel.servlet.force-await

When set to true used in conjunction with quarkus.camel.servlet.async = true, this will force route processing to run synchronously.

boolean

false

quarkus.camel.servlet.executor-ref

The name of a bean to configure an optional custom thread pool for handling Camel Servlet processing.

string

 

quarkus.camel.servlet.multipart.location

An absolute path to a directory on the file system to store files temporarily while the parts are processed or when the size of the file exceeds the specified file-size-threshold configuration value.

string

${java.io.tmpdir}

quarkus.camel.servlet.multipart.max-file-size

The maximum size allowed in bytes for uploaded files. The default size (-1) allows an unlimited size.

long

-1

quarkus.camel.servlet.multipart.max-request-size

The maximum size allowed in bytes for a multipart/form-data request. The default size (-1) allows an unlimited size.

long

-1

quarkus.camel.servlet.multipart.file-size-threshold

The file size in bytes after which the file will be temporarily stored on disk.

int

0

[[quarkus-camel-servlet—​named-servlets—​url-patterns]] quarkus.camel.servlet."named-servlets".url-patterns

A comma separated list of path patterns under which the CamelServlet should be accessible. Example path patterns: /*, /services/*

List of string

 

[[quarkus-camel-servlet—​named-servlets—​servlet-class]] quarkus.camel.servlet."named-servlets".servlet-class

A fully qualified name of a servlet class to serve paths that match url-patterns

string

org.apache.camel.component.servlet.CamelHttpTransportServlet

[[quarkus-camel-servlet—​named-servlets—​servlet-name]] quarkus.camel.servlet."named-servlets".servlet-name

A servletName as it would be defined in a web.xml file or in the jakarta.servlet.annotation.WebServlet#name() annotation.

string

CamelServlet

[[quarkus-camel-servlet—​named-servlets—​load-on-startup]] quarkus.camel.servlet."named-servlets".load-on-startup

Sets the loadOnStartup priority on the Servlet. A loadOnStartup is a value greater than or equal to zero, indicates to the container the initialization priority of the Servlet. If loadOnStartup is a negative integer, the Servlet is initialized lazily.

int

-1

quarkus.camel.servlet."named-servlets".async

Enables Camel to benefit from asynchronous Servlet support.

boolean

false

[[quarkus-camel-servlet—​named-servlets—​force-await]] quarkus.camel.servlet."named-servlets".force-await

When set to true used in conjunction with quarkus.camel.servlet.async = true, this will force route processing to run synchronously.

boolean

false

[[quarkus-camel-servlet—​named-servlets—​executor-ref]] quarkus.camel.servlet."named-servlets".executor-ref

The name of a bean to configure an optional custom thread pool for handling Camel Servlet processing.

string

 

[[quarkus-camel-servlet—​named-servlets—​multipart-location]] quarkus.camel.servlet."named-servlets".multipart.location

An absolute path to a directory on the file system to store files temporarily while the parts are processed or when the size of the file exceeds the specified file-size-threshold configuration value.

string

${java.io.tmpdir}

[[quarkus-camel-servlet—​named-servlets—​multipart-max-file-size]] quarkus.camel.servlet."named-servlets".multipart.max-file-size

The maximum size allowed in bytes for uploaded files. The default size (-1) allows an unlimited size.

long

-1

[[quarkus-camel-servlet—​named-servlets—​multipart-max-request-size]] quarkus.camel.servlet."named-servlets".multipart.max-request-size

The maximum size allowed in bytes for a multipart/form-data request. The default size (-1) allows an unlimited size.

long

-1

[[quarkus-camel-servlet—​named-servlets—​multipart-file-size-threshold]] quarkus.camel.servlet."named-servlets".multipart.file-size-threshold

The file size in bytes after which the file will be temporarily stored on disk.

int

0

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.105. Slack

Send and receive messages to/from Slack.

2.105.1. What’s inside

Refer to the above link for usage and configuration details.

2.105.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-slack</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.105.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.106. SMB

SMB component which consumes natively from file shares using the Server Message Block (SMB, also known as Common Internet File System - CIFS) protocol

2.106.1. What’s inside

Refer to the above link for usage and configuration details.

2.106.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-smb</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.107. SNMP

Receive traps and poll SNMP (Simple Network Management Protocol) capable devices.

2.107.1. What’s inside

Refer to the above link for usage and configuration details.

2.107.2. Maven coordinates

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-snmp</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.108. SOAP dataformat

Marshal Java objects to SOAP messages and back.

2.108.1. What’s inside

Refer to the above link for usage and configuration details.

2.108.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-soap</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.109. Splunk

Publish or search for events in Splunk.

2.109.1. What’s inside

Refer to the above link for usage and configuration details.

2.109.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-splunk</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.109.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.110. Splunk HEC

The splunk component allows to publish events in Splunk using the HTTP Event Collector.

2.110.1. What’s inside

Refer to the above link for usage and configuration details.

2.110.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-splunk-hec</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.110.3. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.111. Spring RabbitMQ

Send and receive messages from RabbitMQ using Spring RabbitMQ client.

2.111.1. What’s inside

Refer to the above link for usage and configuration details.

2.111.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-spring-rabbitmq</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.111.3. Camel Quarkus limitations

You can use this extension without any special configuration in JVM mode.

In native mode you need to add

quarkus.native.additional-build-args = -H:+InlineBeforeAnalysis
Copy to Clipboard Toggle word wrap

to your application.properties. This is to allow inlining of some static methods that would otherwise cause build failures (see this GraalVM issue).

2.112. SQL

Perform SQL queries.

2.112.1. What’s inside

Refer to the above links for usage and configuration details.

2.112.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-sql</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.112.3. Additional Camel Quarkus configuration

2.112.3.1. Configuring a DataSource

This extension leverages Quarkus Agroal for DataSource support. Setting up a DataSource can be achieved via configuration properties.

quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=your-username
quarkus.datasource.password=your-password
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/your-database
quarkus.datasource.jdbc.max-size=16
Copy to Clipboard Toggle word wrap

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.

In dev and test mode you can take advantage of Configuration Free Databases. The Camel SQL component will be automatically configured to use a DataSource that points to a local containerized instance of the database matching the JDBC driver type that you have selected.

2.112.3.2. SQL scripts

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
Copy to Clipboard Toggle word wrap

In order to use SQL aggregation repositories like JdbcAggregationRepository in native mode, you must enable native serialization support.

In addition, if your exchange bodies are custom types, they must be registered for serialization by annotating their class declaration with @RegisterForReflection(serialization = true).

2.113. Telegram

Send and receive messages using the Telegram Bot API.

2.113.1. What’s inside

Refer to the above link for usage and configuration details.

2.113.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-telegram</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.113.3. Usage

2.113.4. Webhook Mode

The Telegram extension supports usage in the webhook mode.

In order to enable webhook mode, users need first to add a REST implementation to their application. Maven users, for example, can add camel-quarkus-rest extension to their pom.xml file:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-rest</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap
2.113.4.1. Webhook
Important

In this release of Red Hat build of Apache Camel for Quarkus, webhook mode is not supported.

2.113.5. SSL in native mode

This extension auto-enables SSL support in native mode. Hence you do not need to add quarkus.ssl.native=true to your application.properties yourself. See also Quarkus SSL guide.

2.114. Timer

Generate messages in specified intervals using java.util.Timer.

2.114.1. What’s inside

Refer to the above link for usage and configuration details.

2.114.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-timer</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.115. Validator

Validate the payload using XML Schema and JAXP Validation.

2.115.1. What’s inside

Refer to the above link for usage and configuration details.

2.115.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-validator</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.116. Velocity

Transform messages using a Velocity template.

2.116.1. What’s inside

Refer to the above link for usage and configuration details.

2.116.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-velocity</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.116.3. Usage

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 {
}
Copy to Clipboard Toggle word wrap

2.116.4. allowContextMapAll option in native mode

The allowContextMapAll option is not supported in native mode as it requires reflective access to security sensitive camel core classes such as CamelContext & Exchange. This is considered a security risk and thus access to the feature is not provided by default.

2.116.5. Additional Camel Quarkus configuration

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");
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.

2.117. Vert.x HTTP Client

Camel HTTP client support with Vert.x

2.117.1. What’s inside

Refer to the above link for usage and configuration details.

2.117.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-vertx-http</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.117.3. transferException option in native mode

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)
Copy to Clipboard Toggle word wrap

2.117.4. Additional Camel Quarkus configuration

When using the allowJavaSerializedObject option in native mode, the support of serialization might need to be enabled. Please, refer to the native mode user guide for more information.

2.117.5.1. Character encodings

Check the Character encodings section of the Native mode guide if the application is expected to send and receive requests using non-default encodings.

2.118. Vert.x WebSocket

This extension enables you to create WebSocket endpoints to that act as either a WebSocket server, or as a client to connect an existing WebSocket .

It is built on top of the Eclipse Vert.x HTTP server provided by the quarkus-vertx-http extension.

2.118.1. What’s inside

Refer to the above link for usage and configuration details.

2.118.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-vertx-websocket</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.118.3. Usage

2.118.3.1. Vert.x WebSocket consumers

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");
Copy to Clipboard Toggle word wrap
Note

While you do not need to explicitly configure the host/port on the vertx-websocket consumer. If you choose to, the host & port must exactly match the value of the Quarkus HTTP server configuration values for quarkus.http.host and quarkus.http.port. Otherwise an exception will be thrown at runtime.

2.118.3.2. Vert.x WebSocket producers

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");
Copy to Clipboard Toggle word wrap

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");
Copy to Clipboard Toggle word wrap

When producing messages to an external WebSocket server, then you must always provide the host name and port (if required).

2.118.4. Additional Camel Quarkus configuration

2.118.4.1. Vert.x WebSocket server configuration

Configuration of the Vert.x WebSocket server is managed by Quarkus. Refer to the Quarkus HTTP configuration guide for the full list of configuration options.

To configure SSL for the Vert.x WebSocket server, follow the secure connections with SSL guide. Note that configuring the server for SSL with SSLContextParameters is not currently supported.

2.118.4.2. Character encodings

Check the Character encodings section of the Native mode guide if you expect your application to send or receive requests using non-default encodings.

2.119. XJ

Transform JSON and XML message using a XSLT.

2.119.1. What’s inside

Refer to the above link for usage and configuration details.

2.119.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-xj</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.120. XML IO DSL

An XML stack for parsing XML route definitions

2.120.1. What’s inside

Refer to the above link for usage and configuration details.

2.120.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-xml-io-dsl</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.120.3. Additional Camel Quarkus configuration

2.120.3.1. XML file encodings

By default, some XML file encodings may not work out of the box in native mode. Please, check the Character encodings section to learn how to fix.

2.121. XML JAXP

XML JAXP type converters and parsers

2.121.1. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-xml-jaxp</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.122. XPath

Evaluates an XPath expression against an XML payload

2.122.1. What’s inside

Refer to the above link for usage and configuration details.

2.122.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-xpath</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.122.3. Additional Camel Quarkus configuration

This component is able to load xpath expressions from classpath resources. To make it work also in native mode, you need to explicitly embed the expression files in the native executable by using the quarkus.native.resources.includes property.

For instance, the route below would load an XPath expression from a classpath resource named myxpath.txt:

from("direct:start").transform().xpath("resource:classpath:myxpath.txt");
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

More information about selecting resources for inclusion in the native executable can be found at Embedding resource in native executable.

2.123. XSLT Saxon

Transform XML payloads using an XSLT template using Saxon.

2.123.1. What’s inside

Refer to the above link for usage and configuration details.

2.123.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-xslt-saxon</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.124. XSLT

Transforms XML payload using an XSLT template.

2.124.1. What’s inside

Refer to the above link for usage and configuration details.

2.124.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-xslt</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.124.3. Additional Camel Quarkus configuration

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
Copy to Clipboard Toggle word wrap

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

from("file:src/test/resources?noop=true&sortBy=file:name&antInclude=*.xml")
   .routeId("aggregate").noAutoStartup()
   .aggregate(new XsltSaxonAggregationStrategy("xslt/aggregate.xsl"))
   .constant(true)
   .completionFromBatchConsumer()
   .log("after aggregate body: ${body}")
   .to("mock:transformed");
Copy to Clipboard Toggle word wrap

Also, it’s only supported on JVM mode.

2.124.3.1. Configuration

TransformerFactory features can be configured using following property:

quarkus.camel.xslt.features."http\://javax.xml.XMLConstants/feature/secure-processing"=false
Copy to Clipboard Toggle word wrap
2.124.3.2. Extension functions support

Xalan’s extension functions do work properly only when:

  1. Secure-processing is disabled
  2. Functions are defined in a separate jar
  3. Functions are augmented during native build phase. For example, they can be registered for reflection:
@RegisterForReflection(targets = { my.Functions.class })
public class FunctionsConfiguration {
}
Copy to Clipboard Toggle word wrap
Note

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.

Expand
Configuration propertyTypeDefault

quarkus.camel.xslt.sources

A comma separated list of templates to compile.

List of string

 

quarkus.camel.xslt.package-name

The package name for the generated classes.

string

org.apache.camel.quarkus.component.xslt.generated

[[quarkus-camel-xslt-features—​features]] quarkus.camel.xslt.features."features"

TransformerFactory features.

Map<String,Boolean>

 

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

2.125. YAML DSL

An YAML stack for parsing YAML route definitions

2.125.1. What’s inside

Refer to the above link for usage and configuration details.

2.125.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-yaml-dsl</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.125.3. Usage

2.125.3.1. Native mode

The following constructs when defined within Camel YAML DSL markup, require you to register classes for reflection. Refer to the Native mode guide for details.

2.125.3.1.1. Bean definitions

The YAML DSL provides the capability to define beans as follows.

- beans:
    - name: "greetingBean"
      type: "org.acme.GreetingBean"
      properties:
        greeting: "Hello World!"
- route:
    id: "my-yaml-route"
    from:
      uri: "timer:from-yaml?period=1000"
      steps:
        - to: "bean:greetingBean"
Copy to Clipboard Toggle word wrap

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 {
}
Copy to Clipboard Toggle word wrap
2.125.3.1.2. Exception handling

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

- on-exception:
    handled:
      constant: "true"
    exception:
      - "org.acme.MyHandledException"
    steps:
      - transform:
          constant: "Sorry something went wrong"
Copy to Clipboard Toggle word wrap
@RegisterForReflection
public class MyHandledException {
}
Copy to Clipboard Toggle word wrap

throw-exception

- route:
    id: "my-yaml-route"
    from:
      uri: "direct:start"
      steps:
        - choice:
            when:
              - simple: "${body} == 'bad value'"
                steps:
                  - throw-exception:
                      exception-type: "org.acme.ForcedException"
                      message: "Forced exception"
            otherwise:
              steps:
                - to: "log:end"
Copy to Clipboard Toggle word wrap
@RegisterForReflection
public class ForcedException {
}
Copy to Clipboard Toggle word wrap

do-catch

- route:
    id: "my-yaml-route2"
    from:
      uri: "direct:tryCatch"
      steps:
        - do-try:
            steps:
              - to: "direct:readFile"
            do-catch:
              - exception:
                  - "java.io.FileNotFoundException"
                steps:
                  - transform:
                      constant: "do-catch caught an exception"
Copy to Clipboard Toggle word wrap
@RegisterForReflection(targets = FileNotFoundException.class)
public class MyClass {
}
Copy to Clipboard Toggle word wrap

2.126. YAML IO

Dump routes in YAML format

2.126.1. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-yaml-io</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.126.2. Usage

This an auxiliary extension that provides support for Camel route dumping in YAML.

For example, when the application is configured to dump routes on startup with the following configuration in application.properties.

camel.main.dump-routes = yaml
Copy to Clipboard Toggle word wrap

2.127. Zip Deflate Compression

Compress and decompress streams using java.util.zip.Deflater, java.util.zip.Inflater or java.util.zip.GZIPStream.

2.127.1. What’s inside

Refer to the above links for usage and configuration details.

2.127.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-zip-deflater</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

2.128. Zip File

Compression and decompress streams using java.util.zip.ZipStream.

2.128.1. What’s inside

Refer to the above link for usage and configuration details.

2.128.2. Maven coordinates

Create a new project with this extension on code.quarkus.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-zipfile</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

Chapter 3. Quarkus CXF overview

This chapter provides information about Quarkus CXF extensions, CXF modules and CXF annotations supported by Quarkus CXF.

3.1. Quarkus CXF

The following table shows the Quarkus CXF extensions. Click the extension names to learn more about how to configure and use them, and about any known limitations.

Expand
Quarkus CXF extensionSupport levelSinceSupported standards

Quarkus CXF
quarkus-cxf

Stable

0.1.0

JAX-WS, JAXB, WS-Addressing, WS-Policy, MTOM

Quarkus CXF Metrics Feature
quarkus-cxf-rt-features-metrics

Stable

0.14.0

 

Quarkus CXF OpenTelemetry
quarkus-cxf-integration-tracing-opentelemetry

Stable

2.7.0

 

Quarkus CXF WS-Security
quarkus-cxf-rt-ws-security

Stable

0.14.0

WS-Security, WS-SecurityPolicy

Quarkus CXF WS-ReliableMessaging
quarkus-cxf-rt-ws-rm

Stable

1.5.3

WS-ReliableMessaging

Quarkus CXF Security Token Service (STS)
quarkus-cxf-services-sts

Stable

1.5.3

WS-Trust

Quarkus CXF HTTP Async Transport
quarkus-cxf-rt-transports-http-hc5

Stable

1.1.0

 

Quarkus CXF XJC Plugins
quarkus-cxf-xjc-plugins

Stable

1.5.11

 

3.2. Supported CXF modules

Here is a list of CXF modules supported by Quarkus CXF. You should typically not depend on these directly, but rather use some of the extensions listed above that brings the given CXF module as a transitive dependency.

3.2.1. Front ends

Out of CXF front ends only the JAX-WS front end is fully supported by quarkus-cxf.

The Simple front end may work in JVM mode, but it is not tested properly. We advise not to use it.

3.2.2. Data Bindings

Out of CXF Data Bindings only the following ones are supported:

3.2.3. Transports

Out of CXF Transports only the following ones are supported:

3.2.4. Tools

3.2.5. Supported SOAP Bindings

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:

Expand
BindingProperty Value

SOAP 1.1 (default)

http://schemas.xmlsoap.org/wsdl/soap/http

SOAP 1.2

http://www.w3.org/2003/05/soap/bindings/HTTP/

SOAP 1.1 with MTOM

http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true

SOAP 1.2 with MTOM

http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true

3.3. Unsupported CXF modules

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.

Expand
CXF moduleAlternative

JAX-RS
cxf-rt-frontend-jaxrs
cxf-rt-rs-client

Use Quarkus RESTEasy

Fediz

Use Quarkus OpenID Connect

Aegis

Use JAXB and JAX-WS

DOSGI
Karaf

 

JiBX

Use JAXB and JAX-WS

Local transport
cxf-rt-transports-local

Use HTTP transport

JMS transport
cxf-rt-transports-jms

Use HTTP transport

JBI
cxf-rt-transports-jbi
cxf-rt-bindings-jbi

Deprecated in CXF use HTTP transport

UDP transport
cxf-rt-transports-udp

Use HTTP transport

Coloc transport

Use HTTP transport

WebSocket transport
cxf-rt-transports-websocket

Use HTTP transport

Clustering
cxf-rt-features-clustering

Planned

CORBA cxf-rt-bindings-corba

Use JAX-WS

SDO databinding
cxf-rt-databinding-sdo

 

XMLBeans

Deprecated in CXF

Javascript frontend

Use JAX-WS

JCA transport

Use HTTP transport

WS-Transfer runtime
cxf-rt-ws-transfer

 

Throttling
cxf-rt-features-throttling

Use load balancer

3.4. Supported CXF annotations

Here is the status of CXF annotations on Quarkus. Unless stated otherwise, the support is available via io.quarkiverse.cxf:quarkus-cxf.

Expand
AnnotationStatus

@org.apache.cxf.feature.Features

Supported

@org.apache.cxf.interceptor.InInterceptors

Supported

@org.apache.cxf.interceptor.OutInterceptors

Supported

@org.apache.cxf.interceptor.OutFaultInterceptors

Supported

@org.apache.cxf.interceptor.InFaultInterceptors

Supported

@org.apache.cxf.annotations.WSDLDocumentation

Supported

@org.apache.cxf.annotations.WSDLDocumentationCollection

Supported

@org.apache.cxf.annotations.SchemaValidation

Supported

@org.apache.cxf.annotations.DataBinding

Only the default value org.apache.cxf.jaxb.JAXBDataBinding is supported

@org.apache.cxf.ext.logging.Logging

Supported

@org.apache.cxf.annotations.GZIP

Supported

@org.apache.cxf.annotations.FastInfoset

Supported via com.sun.xml.fastinfoset:FastInfoset dependency

@org.apache.cxf.annotations.EndpointProperty

Supported

@org.apache.cxf.annotations.EndpointProperties

Supported

@org.apache.cxf.annotations.Policy

Supported

@org.apache.cxf.annotations.Policies

Supported

@org.apache.cxf.annotations.UseAsyncMethod

Supported

Chapter 4. Quarkus CXF extensions reference

This chapter provides reference information about Quarkus CXF extensions.

4.1. Quarkus CXF

Core capabilities for implementing SOAP clients and JAX-WS services.

4.1.1. Maven coordinates

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>
Copy to Clipboard Toggle word wrap

4.1.2. Supported standards

4.1.3. Usage

There are several chapters in the User guide covering the usage of this extension:

4.1.4. Configuration

lock Configuration property fixed at build time. All other configuration properties are overridable at runtime.

Expand
Configuration propertyTypeDefault

lock quarkus.cxf.codegen.wsdl2java.enabled

boolean

true

If true wsdl2java code generation is run whenever there are WSDL resources found on default or custom defined locations; otherwise wsdl2java is not executed.

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_ENABLED
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.codegen.wsdl2java.includes

List of string

 

A comma separated list of glob patterns for selecting WSDL files which should be processed with wsdl2java tool. The paths are relative to src/main/resources or src/test/resources directories of the current Maven or Gradle module. The glob syntax is specified in io.quarkus.util.GlobUtil.

Examples:

  • calculator.wsdl,fruits.wsdl will match src/main/resources/calculator.wsdl and src/main/resources/fruits.wsdl under the current Maven or Gradle module, but will not match anything like src/main/resources/subdir/calculator.wsdl
  • my-*-service.wsdl will match src/main/resources/my-foo-service.wsdl and src/main/resources/my-bar-service.wsdl
  • **.wsdl will match any of the above There is a separate wsdl2java execution for each of the matching WSDL files. 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:
# Parameters for foo.wsdl
quarkus.cxf.codegen.wsdl2java.foo-params.includes = wsdl/foo.wsdl
quarkus.cxf.codegen.wsdl2java.foo-params.wsdl-location = wsdl/foo.wsdl
# Parameters for bar.wsdl
quarkus.cxf.codegen.wsdl2java.bar-params.includes = wsdl/bar.wsdl
quarkus.cxf.codegen.wsdl2java.bar-params.wsdl-location = wsdl/bar.wsdl
quarkus.cxf.codegen.wsdl2java.bar-params.xjc = ts
Copy to Clipboard Toggle word wrap
File extensions

File extensions other than .wsdl will work during normal builds, but changes in the matching files may get overseen in Quarkus dev mode. We recommend that you always use the .wsdl extension.

There is no default value for this option, so wsdl2java code generation is disabled by default.

Specifying quarkus.cxf.codegen.wsdl2java.my-name.excludes without setting any includes will cause a build time error.

Make sure that the file sets selected by quarkus.cxf.codegen.wsdl2java.includes and quarkus.cxf.codegen.wsdl2java.[whatever-name].includes do not overlap. Otherwise a build time exception will be thrown.

The files from src/main/resources selected by includes and excludes are automatically included in native image and therefore you do not need to include them via quarkus.cxf.wsdl-path (deprecated) or quarkus.native.resources.includes/excludes.

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_INCLUDES
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.codegen.wsdl2java.excludes

List of string

 

A comma separated list of path patterns for selecting WSDL files which should not be processed with wsdl2java tool. The paths are relative to src/main/resources or src/test/resources directories of the current Maven or Gradle module. Same syntax as includes.

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_EXCLUDES
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.codegen.wsdl2java.output-directory

string

 

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 target/generated-sources/wsdl2java, while for Gradle it is build/classes/java/quarkus-generated-sources/wsdl2java.

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 target directory for Maven or outside build directory for Gradle, you need to take care for cleaning stale resources generated by previous builds. E.g. if you change the value of package-names option from org.foo to org.bar you need to take care for the removal of the removal of the old package org.foo.

This will be passed as option -d to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_OUTPUT_DIRECTORY
Since Quarkus CXF: 2.6.0

lock quarkus.cxf.codegen.wsdl2java.package-names

List of string

 

A comma separated list of tokens; each token can be one of the following:

  • A Java package under which the Java source files should be generated
  • A string of the form namespaceURI=packageName - in this case the entities coming from the given namespace URI will be generated under the given Java package.

This will be passed as option -p to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_PACKAGE_NAMES
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.exclude-namespace-uris

List of string

 

A comma separated list of WSDL schema namespace URIs to ignore when generating Java code.

This will be passed as option -nexclude to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_EXCLUDE_NAMESPACE_URIS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.service-name

string

 

The WSDL service name to use for the generated code.

This will be passed as option -sn to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_SERVICE_NAME
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.bindings

List of string

 

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 -b to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_BINDINGS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.validate

boolean

false

If true, WSDLs are validated before processing; otherwise the WSDLs are not validated.

This will be passed as option -validate to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_VALIDATE
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.wsdl-location

string

 

Specifies the value of the @WebServiceClient annotation’s wsdlLocation property.

This will be passed as option -wsdlLocation to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_WSDL_LOCATION
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.xjc

List of string

 

A comma separated list of XJC extensions to enable. The following extensions are available through io.quarkiverse.cxf:quarkus-cxf-xjc-plugins dependency:

  • bg - generate getX() methods for boolean fields instead of isX()
  • bgi - generate both isX() and getX() methods for boolean fields
  • dv - initialize fields mapped from elements/attributes with their default values
  • javadoc - generates JavaDoc based on xsd:documentation
  • property-listener - add a property listener and the code for triggering the property change events to setter methods
  • ts - generate toString() methods
  • wsdlextension - generate WSDL extension methods in root classes

These values correspond to -wsdl2java options -xjc-Xbg, -xjc-Xbgi, -xjc-Xdv, -xjc-Xjavadoc, -xjc-Xproperty-listener, -xjc-Xts and -xjc-Xwsdlextension respectively.

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_XJC
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.exception-super

string

java.lang.Exception

A fully qualified class name to use as a superclass for fault beans generated from wsdl:fault elements

This will be passed as option -exceptionSuper to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_EXCEPTION_SUPER
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.async-methods

List of string

 

A comma separated list of SEI methods for which asynchronous sibling methods should be generated; similar to enableAsyncMapping in a JAX-WS binding file

This will be passed as option -asyncMethods to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_ASYNC_METHODS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.bare-methods

List of string

 

A comma separated list of SEI methods for which wrapper style sibling methods should be generated; similar to enableWrapperStyle in JAX-WS binding file

This will be passed as option -bareMethods to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_BARE_METHODS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.mime-methods

List of string

 

A comma separated list of SEI methods for which mime:content mapping should be enabled; similar to enableMIMEContent in JAX-WS binding file

This will be passed as option -mimeMethods to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_MIME_METHODS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java.additional-params

List of string

 

A comma separated list of additional command line parameters that should be passed to CXF wsdl2java tool along with the files selected by includes and excludes. Example: -keep,-dex,false. Check wsdl2java documentation for all supported options.

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA_ADDITIONAL_PARAMS
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.java2ws.enabled

boolean

true

If true java2ws WSDL generation is run whenever there are Java classes selected via includes and excludes options; otherwise java2ws is not executed.

Environment variable: QUARKUS_CXF_JAVA2WS_ENABLED
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.java2ws.includes

List of string

 

A comma separated list of glob patterns for selecting class names which should be processed with java2ws tool. The glob syntax is specified in io.quarkus.util.GlobUtil. The patterns are matched against fully qualified class names, such as org.acme.MyClass.

The universe of class names to which includes and excludes are applied is defined as follows: 1. Only classes visible in Jandex are considered. 2. From those, only the ones annotated with @WebService are selected.

Examples:

Let’s say that the application contains two classes annotated with @WebService and that both are visible in Jandex. Their names are org.foo.FruitWebService and org.bar.HelloWebService.

Then

  • quarkus.cxf.java2ws.includes = **.*WebService will match both class names
  • quarkus.cxf.java2ws.includes = org.foo.* will match only org.foo.FruitWebService There is a separate java2ws execution for each of the matching class names. If you need different additional-params for each class, you may want to define a separate named parameter set for each one of them. Here is an example:
# Parameters for the foo package
quarkus.cxf.java2ws.foo-params.includes = org.foo.*
quarkus.cxf.java2ws.foo-params.additional-params = -servicename,FruitService
# Parameters for the bar package
quarkus.cxf.java2ws.bar-params.includes = org.bar.*
quarkus.cxf.java2ws.bar-params.additional-params = -servicename,HelloService
Copy to Clipboard Toggle word wrap

There is no default value for this option, so java2ws WSDL generation is effectively disabled by default.

Specifying quarkus.cxf.java2ws.excludes without setting any includes will cause a build time error.

Make sure that the class names selected by quarkus.cxf.java2ws.includes and quarkus.cxf.java2ws.[whatever-name].includes do not overlap. Otherwise a build time exception will be thrown.

If you would like to include the generated WSDL files in native image, you need to add them yourself using quarkus.native.resources.includes/excludes.

Environment variable: QUARKUS_CXF_JAVA2WS_INCLUDES
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.java2ws.excludes

List of string

 

A comma separated list of glob patterns for selecting java class names which should not be processed with java2ws tool. Same syntax as includes.

Environment variable: QUARKUS_CXF_JAVA2WS_EXCLUDES
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.java2ws.additional-params

List of string

 

A comma separated list of additional command line parameters that should be passed to CXF java2ws tool along with the files selected by includes and excludes. Example: -portname,12345. Check java2ws documentation for all supported options.

Supported options

Currently, only options related to generation of WSDL from Java are supported.

Environment variable: QUARKUS_CXF_JAVA2WS_ADDITIONAL_PARAMS
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.java2ws.wsdl-name-template

string

%CLASSES_DIR%/wsdl/%SIMPLE_CLASS_NAME%.wsdl

A template for the names of generated WSDL files.

There are 4 place holders, which can be used in the template:

  • %SIMPLE_CLASS_NAME% - the simple class name of the Java class from which we are generating
  • %FULLY_QUALIFIED_CLASS_NAME% - the fully qualified name from which we are generating with all dots are replaced replaced by underscores
  • %TARGET_DIR% - the target directory of the current module of the current build tool; typically target for Maven and build for Gradle.
  • %CLASSES_DIR% - the compiler output directory of the current module of the current build tool; typically target/classes for Maven and build/classes for Gradle.

Environment variable: QUARKUS_CXF_JAVA2WS_WSDL_NAME_TEMPLATE
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.path

string

/services

The default path for CXF resources.

Earlier versions

The default value before Quarkus CXF version 2.0.0 was /.

Environment variable: QUARKUS_CXF_PATH
Since Quarkus CXF: 1.0.0

lock quarkus.cxf.min-chunk-size

int

128

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: QUARKUS_CXF_MIN_CHUNK_SIZE
Since Quarkus CXF: 2.6.0

lock quarkus.cxf.output-buffer-size

int

8191

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: QUARKUS_CXF_OUTPUT_BUFFER_SIZE
Since Quarkus CXF: 2.6.0

lock quarkus.cxf.http-conduit-factory

QuarkusCXFDefault, CXFDefault, VertxHttpClientHTTPConduitFactory, HttpClientHTTPConduitFactory, URLConnectionHTTPConduitFactory

 

Select the HTTPConduitFactory implementation for all clients except the ones that override this setting via quarkus.cxf.client."client-name".http-conduit-factory.

  • QuarkusCXFDefault (default): if io.quarkiverse.cxf:quarkus-cxf-rt-transports-http-hc5 is present in class path, then its HTTPConduitFactory implementation will be used; otherwise this value is equivalent with URLConnectionHTTPConduitFactory (this may change, once issue #992 gets resolved in CXF)
  • CXFDefault: the selection of HTTPConduitFactory implementation is left to CXF
  • VertxHttpClientHTTPConduitFactory: (Experimental) the HTTPConduitFactory for this client will be set to an implementation always returning io.quarkiverse.cxf.vertx.http.client.VertxHttpClientHTTPConduit. This will use io.vertx.core.http.HttpClient as the underlying HTTP client. Since Quarkus CXF 3.13.0.
  • HttpClientHTTPConduitFactory: the HTTPConduitFactory will be set to an implementation always returning org.apache.cxf.transport.http.HttpClientHTTPConduit. This will use java.net.http.HttpClient as the underlying HTTP client.
  • URLConnectionHTTPConduitFactory: the HTTPConduitFactory will be set to an implementation always returning org.apache.cxf.transport.http.URLConnectionHTTPConduit. This will use java.net.HttpURLConnection as the underlying HTTP client.

Environment variable: QUARKUS_CXF_HTTP_CONDUIT_FACTORY
Since Quarkus CXF: 2.3.0

quarkus.cxf.decoupled-endpoint-base

string

 

An URI base to use as a prefix of quarkus.cxf.client."client-name".decoupled-endpoint. You will typically want to set this to something like the following:

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}
Copy to Clipboard Toggle word wrap

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 org.apache.cxf.ws.addressing.decoupled.endpoint.base key. Here is an example how to do that from a RESTeasy handler method:

import java.util.Map;
import jakarta.inject.Inject;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.UriInfo;
import jakarta.xml.ws.BindingProvider;
import io.quarkiverse.cxf.annotation.CXFClient;
import org.eclipse.microprofile.config.inject.ConfigProperty;

@Path("/my-rest")
public class MyRestEasyResource {

    @Inject
    @CXFClient("hello")
    HelloService helloService;

    @ConfigProperty(name = "quarkus.cxf.path")
                     String quarkusCxfPath;

    @POST
    @Path("/hello")
    @Produces(MediaType.TEXT_PLAIN)
        public String hello(String body, @Context UriInfo uriInfo) throws IOException {

        // You may consider doing this only once if you are sure that your service is accessed
        // through a single hostname
        String decoupledEndpointBase = uriInfo.getBaseUriBuilder().path(quarkusCxfPath);
        Map>String, Object< requestContext = ((BindingProvider)
        helloService).getRequestContext();
        requestContext.put("org.apache.cxf.ws.addressing.decoupled.endpoint.base",
        decoupledEndpointBase);

        return wsrmHelloService.hello(body);
    }
}
Copy to Clipboard Toggle word wrap

Environment variable: QUARKUS_CXF_DECOUPLED_ENDPOINT_BASE
Since Quarkus CXF: 2.7.0

quarkus.cxf.logging.enabled-for

clients, services, both, none

none

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 quarkus.cxf.endpoint."/endpoint-path".logging.enabled or quarkus.cxf.client."client-name".logging.enabled respectively.

Environment variable: QUARKUS_CXF_LOGGING_ENABLED_FOR
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.pretty

boolean

false

If true, the XML elements will be indented in the log; otherwise they will appear unindented. This setting can be overridden per client or service endpoint using quarkus.cxf.endpoint."/endpoint-path".logging.pretty or quarkus.cxf.client."client-name".logging.pretty respectively.

Environment variable: QUARKUS_CXF_LOGGING_PRETTY
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.limit

int

49152

A message length in bytes at which it is truncated in the log. This setting can be overridden per client or service endpoint using quarkus.cxf.endpoint."/endpoint-path".logging.limit or quarkus.cxf.client."client-name".logging.limit respectively.

Environment variable: QUARKUS_CXF_LOGGING_LIMIT
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.in-mem-threshold

long

-1

A message length in bytes at which it will be written to disk. -1 is unlimited. This setting can be overridden per client or service endpoint using quarkus.cxf.endpoint."/endpoint-path".logging.in-mem-threshold or quarkus.cxf.client."client-name".logging.in-mem-threshold respectively.

Environment variable: QUARKUS_CXF_LOGGING_IN_MEM_THRESHOLD
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.log-binary

boolean

false

If true, binary payloads will be logged; otherwise they won’t be logged. This setting can be overridden per client or service endpoint using quarkus.cxf.endpoint."/endpoint-path".logging.log-binary or quarkus.cxf.client."client-name".logging.log-binary respectively.

Environment variable: QUARKUS_CXF_LOGGING_LOG_BINARY
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.log-multipart

boolean

true

If true, multipart payloads will be logged; otherwise they won’t be logged. This setting can be overridden per client or service endpoint using quarkus.cxf.endpoint."/endpoint-path".logging.log-multipart or quarkus.cxf.client."client-name".logging.log-multipart respectively.

Environment variable: QUARKUS_CXF_LOGGING_LOG_MULTIPART
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.verbose

boolean

true

If true, verbose logging will be enabled; otherwise it won’t be enabled. This setting can be overridden per client or service endpoint using quarkus.cxf.endpoint."/endpoint-path".logging.verbose or quarkus.cxf.client."client-name".logging.verbose respectively.

Environment variable: QUARKUS_CXF_LOGGING_VERBOSE
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.in-binary-content-media-types

List of string

 

A comma separated list of additional binary media types to add to the default values in the LoggingInInterceptor whose content will not be logged unless log-binary is true. This setting can be overridden per client or service endpoint using quarkus.cxf.endpoint."/endpoint-path".logging.in-binary-content-media-types or quarkus.cxf.client."client-name".logging.in-binary-content-media-types respectively.

Environment variable: QUARKUS_CXF_LOGGING_IN_BINARY_CONTENT_MEDIA_TYPES
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.out-binary-content-media-types

List of string

 

A comma separated list of additional binary media types to add to the default values in the LoggingOutInterceptor whose content will not be logged unless log-binary is true. This setting can be overridden per client or service endpoint using quarkus.cxf.endpoint."/endpoint-path".logging.out-binary-content-media-types or quarkus.cxf.client."client-name".logging.out-binary-content-media-types respectively.

Environment variable: QUARKUS_CXF_LOGGING_OUT_BINARY_CONTENT_MEDIA_TYPES
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.binary-content-media-types

List of string

 

A comma separated list of additional binary media types to add to the default values in the LoggingOutInterceptor and LoggingInInterceptor whose content will not be logged unless log-binary is true. This setting can be overridden per client or service endpoint using quarkus.cxf.endpoint."/endpoint-path".logging.binary-content-media-types or quarkus.cxf.client."client-name".logging.binary-content-media-types respectively.

Environment variable: QUARKUS_CXF_LOGGING_BINARY_CONTENT_MEDIA_TYPES
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.sensitive-element-names

List of string

 

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 quarkus.cxf.endpoint."/endpoint-path".logging.sensitive-element-names or quarkus.cxf.client."client-name".logging.sensitive-element-names respectively.

Environment variable: QUARKUS_CXF_LOGGING_SENSITIVE_ELEMENT_NAMES
Since Quarkus CXF: 2.6.0

quarkus.cxf.logging.sensitive-protocol-header-names

List of string

 

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 quarkus.cxf.endpoint."/endpoint-path".logging.sensitive-protocol-header-names or quarkus.cxf.client."client-name".logging.sensitive-protocol-header-names respectively.

Environment variable: QUARKUS_CXF_LOGGING_SENSITIVE_PROTOCOL_HEADER_NAMES
Since Quarkus CXF: 2.6.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".includes

List of string

 

A comma separated list of glob patterns for selecting WSDL files which should be processed with wsdl2java tool. The paths are relative to src/main/resources or src/test/resources directories of the current Maven or Gradle module. The glob syntax is specified in io.quarkus.util.GlobUtil.

Examples:

  • calculator.wsdl,fruits.wsdl will match src/main/resources/calculator.wsdl and src/main/resources/fruits.wsdl under the current Maven or Gradle module, but will not match anything like src/main/resources/subdir/calculator.wsdl
  • my-*-service.wsdl will match src/main/resources/my-foo-service.wsdl and src/main/resources/my-bar-service.wsdl
  • **.wsdl will match any of the above There is a separate wsdl2java execution for each of the matching WSDL files. 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:
# Parameters for foo.wsdl
quarkus.cxf.codegen.wsdl2java.foo-params.includes = wsdl/foo.wsdl
quarkus.cxf.codegen.wsdl2java.foo-params.wsdl-location = wsdl/foo.wsdl
# Parameters for bar.wsdl
quarkus.cxf.codegen.wsdl2java.bar-params.includes = wsdl/bar.wsdl
quarkus.cxf.codegen.wsdl2java.bar-params.wsdl-location = wsdl/bar.wsdl
quarkus.cxf.codegen.wsdl2java.bar-params.xjc = ts
Copy to Clipboard Toggle word wrap
File extensions

File extensions other than .wsdl will work during normal builds, but changes in the matching files may get overseen in Quarkus dev mode. We recommend that you always use the .wsdl extension.

There is no default value for this option, so wsdl2java code generation is disabled by default.

Specifying quarkus.cxf.codegen.wsdl2java.my-name.excludes without setting any includes will cause a build time error.

Make sure that the file sets selected by quarkus.cxf.codegen.wsdl2java.includes and quarkus.cxf.codegen.wsdl2java.[whatever-name].includes do not overlap. Otherwise a build time exception will be thrown.

The files from src/main/resources selected by includes and excludes are automatically included in native image and therefore you do not need to include them via quarkus.cxf.wsdl-path (deprecated) or quarkus.native.resources.includes/excludes.

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__INCLUDES
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".excludes

List of string

 

A comma separated list of path patterns for selecting WSDL files which should not be processed with wsdl2java tool. The paths are relative to src/main/resources or src/test/resources directories of the current Maven or Gradle module. Same syntax as includes.

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__EXCLUDES
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".output-directory

string

 

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 target/generated-sources/wsdl2java, while for Gradle it is build/classes/java/quarkus-generated-sources/wsdl2java.

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 target directory for Maven or outside build directory for Gradle, you need to take care for cleaning stale resources generated by previous builds. E.g. if you change the value of package-names option from org.foo to org.bar you need to take care for the removal of the removal of the old package org.foo.

This will be passed as option -d to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__OUTPUT_DIRECTORY
Since Quarkus CXF: 2.6.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".package-names

List of string

 

A comma separated list of tokens; each token can be one of the following:

  • A Java package under which the Java source files should be generated
  • A string of the form namespaceURI=packageName - in this case the entities coming from the given namespace URI will be generated under the given Java package.

This will be passed as option -p to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__PACKAGE_NAMES
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".exclude-namespace-uris

List of string

 

A comma separated list of WSDL schema namespace URIs to ignore when generating Java code.

This will be passed as option -nexclude to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__EXCLUDE_NAMESPACE_URIS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".service-name

string

 

The WSDL service name to use for the generated code.

This will be passed as option -sn to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__SERVICE_NAME
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".bindings

List of string

 

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 -b to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__BINDINGS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".validate

boolean

false

If true, WSDLs are validated before processing; otherwise the WSDLs are not validated.

This will be passed as option -validate to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__VALIDATE
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".wsdl-location

string

 

Specifies the value of the @WebServiceClient annotation’s wsdlLocation property.

This will be passed as option -wsdlLocation to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__WSDL_LOCATION
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".xjc

List of string

 

A comma separated list of XJC extensions to enable. The following extensions are available through io.quarkiverse.cxf:quarkus-cxf-xjc-plugins dependency:

  • bg - generate getX() methods for boolean fields instead of isX()
  • bgi - generate both isX() and getX() methods for boolean fields
  • dv - initialize fields mapped from elements/attributes with their default values
  • javadoc - generates JavaDoc based on xsd:documentation
  • property-listener - add a property listener and the code for triggering the property change events to setter methods
  • ts - generate toString() methods
  • wsdlextension - generate WSDL extension methods in root classes

These values correspond to -wsdl2java options -xjc-Xbg, -xjc-Xbgi, -xjc-Xdv, -xjc-Xjavadoc, -xjc-Xproperty-listener, -xjc-Xts and -xjc-Xwsdlextension respectively.

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__XJC
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".exception-super

string

java.lang.Exception

A fully qualified class name to use as a superclass for fault beans generated from wsdl:fault elements

This will be passed as option -exceptionSuper to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__EXCEPTION_SUPER
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".async-methods

List of string

 

A comma separated list of SEI methods for which asynchronous sibling methods should be generated; similar to enableAsyncMapping in a JAX-WS binding file

This will be passed as option -asyncMethods to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__ASYNC_METHODS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".bare-methods

List of string

 

A comma separated list of SEI methods for which wrapper style sibling methods should be generated; similar to enableWrapperStyle in JAX-WS binding file

This will be passed as option -bareMethods to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__BARE_METHODS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".mime-methods

List of string

 

A comma separated list of SEI methods for which mime:content mapping should be enabled; similar to enableMIMEContent in JAX-WS binding file

This will be passed as option -mimeMethods to wsdl2java

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__MIME_METHODS
Since Quarkus CXF: 2.4.0

lock quarkus.cxf.codegen.wsdl2java."named-parameter-sets".additional-params

List of string

 

A comma separated list of additional command line parameters that should be passed to CXF wsdl2java tool along with the files selected by includes and excludes. Example: -keep,-dex,false. Check wsdl2java documentation for all supported options.

Environment variable: QUARKUS_CXF_CODEGEN_WSDL2JAVA__NAMED_PARAMETER_SETS__ADDITIONAL_PARAMS
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.java2ws."named-parameter-sets".includes

List of string

 

A comma separated list of glob patterns for selecting class names which should be processed with java2ws tool. The glob syntax is specified in io.quarkus.util.GlobUtil. The patterns are matched against fully qualified class names, such as org.acme.MyClass.

The universe of class names to which includes and excludes are applied is defined as follows: 1. Only classes visible in Jandex are considered. 2. From those, only the ones annotated with @WebService are selected.

Examples:

Let’s say that the application contains two classes annotated with @WebService and that both are visible in Jandex. Their names are org.foo.FruitWebService and org.bar.HelloWebService.

Then

  • quarkus.cxf.java2ws.includes = **.*WebService will match both class names
  • quarkus.cxf.java2ws.includes = org.foo.* will match only org.foo.FruitWebService There is a separate java2ws execution for each of the matching class names. If you need different additional-params for each class, you may want to define a separate named parameter set for each one of them. Here is an example:
# Parameters for the foo package
quarkus.cxf.java2ws.foo-params.includes = org.foo.*
quarkus.cxf.java2ws.foo-params.additional-params = -servicename,FruitService
# Parameters for the bar package
quarkus.cxf.java2ws.bar-params.includes = org.bar.*
quarkus.cxf.java2ws.bar-params.additional-params = -servicename,HelloService
Copy to Clipboard Toggle word wrap

There is no default value for this option, so java2ws WSDL generation is effectively disabled by default.

Specifying quarkus.cxf.java2ws.excludes without setting any includes will cause a build time error.

Make sure that the class names selected by quarkus.cxf.java2ws.includes and quarkus.cxf.java2ws.[whatever-name].includes do not overlap. Otherwise a build time exception will be thrown.

If you would like to include the generated WSDL files in native image, you need to add them yourself using quarkus.native.resources.includes/excludes.

Environment variable: QUARKUS_CXF_JAVA2WS__NAMED_PARAMETER_SETS__INCLUDES
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.java2ws."named-parameter-sets".excludes

List of string

 

A comma separated list of glob patterns for selecting java class names which should not be processed with java2ws tool. Same syntax as includes.

Environment variable: QUARKUS_CXF_JAVA2WS__NAMED_PARAMETER_SETS__EXCLUDES
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.java2ws."named-parameter-sets".additional-params

List of string

 

A comma separated list of additional command line parameters that should be passed to CXF java2ws tool along with the files selected by includes and excludes. Example: -portname,12345. Check java2ws documentation for all supported options.

Supported options

Currently, only options related to generation of WSDL from Java are supported.

Environment variable: QUARKUS_CXF_JAVA2WS__NAMED_PARAMETER_SETS__ADDITIONAL_PARAMS
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.java2ws."named-parameter-sets".wsdl-name-template

string

%CLASSES_DIR%/wsdl/%SIMPLE_CLASS_NAME%.wsdl

A template for the names of generated WSDL files.

There are 4 place holders, which can be used in the template:

  • %SIMPLE_CLASS_NAME% - the simple class name of the Java class from which we are generating
  • %FULLY_QUALIFIED_CLASS_NAME% - the fully qualified name from which we are generating with all dots are replaced replaced by underscores
  • %TARGET_DIR% - the target directory of the current module of the current build tool; typically target for Maven and build for Gradle.
  • %CLASSES_DIR% - the compiler output directory of the current module of the current build tool; typically target/classes for Maven and build/classes for Gradle.

Environment variable: QUARKUS_CXF_JAVA2WS__NAMED_PARAMETER_SETS__WSDL_NAME_TEMPLATE
Since Quarkus CXF: 2.0.0

lock quarkus.cxf.client."client-name".service-interface

string

 

The client service interface class name

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SERVICE_INTERFACE
Since Quarkus CXF: 1.0.0

lock quarkus.cxf.client."client-name".alternative

boolean

false

Indicates whether this is an alternative proxy client configuration. If true, then this configuration is ignored when configuring a client without annotation @CXFClient.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__ALTERNATIVE
Since Quarkus CXF: 1.0.0

lock quarkus.cxf.client."client-name".native.runtime-initialized

boolean

false

If true, the client dynamic proxy class generated by native compiler will be initialized at runtime; otherwise the proxy class will be initialized at build time.

Setting this to true makes sense if your service endpoint interface references some class initialized at runtime in its method signatures. E.g. Say, your service interface has method int add(Operands o) and the Operands class was requested to be initialized at runtime. Then, without setting this configuration parameter to true, the native compiler will throw an exception saying something like Classes that should be initialized at run time got initialized during image building: org.acme.Operands …​ jdk.proxy<some-number>.$Proxy<some-number> caused initialization of this class. jdk.proxy<some-number>.$Proxy<some-number> is the proxy class generated by the native compiler.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__NATIVE_RUNTIME_INITIALIZED
Since Quarkus CXF: 2.0.0

quarkus.cxf.endpoint."/endpoint-path".implementor

string

 

The service endpoint implementation class

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__IMPLEMENTOR
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".wsdl

string

 

The service endpoint WSDL path

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__WSDL
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".soap-binding

string

 

The URL of the SOAP Binding, should be one of four values:

  • http://schemas.xmlsoap.org/wsdl/soap/http for SOAP11HTTP_BINDING
  • http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true for SOAP11HTTP_MTOM_BINDING
  • http://www.w3.org/2003/05/soap/bindings/HTTP/ for SOAP12HTTP_BINDING
  • http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true for SOAP12HTTP_MTOM_BINDING

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SOAP_BINDING
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".published-endpoint-url

string

 

The published service endpoint URL

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__PUBLISHED_ENDPOINT_URL
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".logging.enabled

true, false, pretty

 

If true or pretty, the message logging will be enabled; otherwise it will not be enabled. If the value is pretty (since 2.7.0), the pretty attribute will effectively be set to true. The default is given by quarkus.cxf.logging.enabled-for.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_ENABLED
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.pretty

boolean

 

If true, the XML elements will be indented in the log; otherwise they will appear unindented. The default is given by quarkus.cxf.logging.pretty

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_PRETTY
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.limit

int

 

A message length in bytes at which it is truncated in the log. The default is given by quarkus.cxf.logging.limit

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_LIMIT
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.in-mem-threshold

long

 

A message length in bytes at which it will be written to disk. -1 is unlimited. The default is given by quarkus.cxf.logging.in-mem-threshold

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_IN_MEM_THRESHOLD
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.log-binary

boolean

 

If true, binary payloads will be logged; otherwise they won’t be logged. The default is given by quarkus.cxf.logging.log-binary

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_LOG_BINARY
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.log-multipart

boolean

 

If true, multipart payloads will be logged; otherwise they won’t be logged. The default is given by quarkus.cxf.logging.log-multipart

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_LOG_MULTIPART
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.verbose

boolean

 

If true, verbose logging will be enabled; otherwise it won’t be enabled. The default is given by quarkus.cxf.logging.verbose

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_VERBOSE
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.in-binary-content-media-types

List of string

 

A comma separated list of additional binary media types to add to the default values in the LoggingInInterceptor whose content will not be logged unless log-binary is true. The default is given by quarkus.cxf.logging.in-binary-content-media-types

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_IN_BINARY_CONTENT_MEDIA_TYPES
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.out-binary-content-media-types

List of string

 

A comma separated list of additional binary media types to add to the default values in the LoggingOutInterceptor whose content will not be logged unless log-binary is true. The default is given by quarkus.cxf.logging.out-binary-content-media-types

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_OUT_BINARY_CONTENT_MEDIA_TYPES
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.binary-content-media-types

List of string

 

A comma separated list of additional binary media types to add to the default values in the LoggingOutInterceptor and LoggingInInterceptor whose content will not be logged unless log-binary is true. The default is given by quarkus.cxf.logging.binary-content-media-types

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_BINARY_CONTENT_MEDIA_TYPES
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.sensitive-element-names

List of string

 

A comma separated list of XML elements containing sensitive information to be masked in the log. The default is given by quarkus.cxf.logging.sensitive-element-names

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_SENSITIVE_ELEMENT_NAMES
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".logging.sensitive-protocol-header-names

List of string

 

A comma separated list of protocol headers containing sensitive information to be masked in the log. The default is given by quarkus.cxf.logging.sensitive-protocol-header-names

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__LOGGING_SENSITIVE_PROTOCOL_HEADER_NAMES
Since Quarkus CXF: 2.6.0

quarkus.cxf.endpoint."/endpoint-path".features

List of string

 

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
Copy to Clipboard Toggle word wrap

In the second case, the #myCustomLoggingFeature bean can be produced as follows:

import org.apache.cxf.ext.logging.LoggingFeature;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;

class Producers {

    @Produces
    @ApplicationScoped
    LoggingFeature myCustomLoggingFeature() {
        LoggingFeature loggingFeature = new LoggingFeature();
        loggingFeature.setPrettyLogging(true);
        return loggingFeature;
    }
}
Copy to Clipboard Toggle word wrap

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__FEATURES
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".handlers

List of string

 

The comma-separated list of Handler classes

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__HANDLERS
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".in-interceptors

List of string

 

The comma-separated list of InInterceptor classes

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__IN_INTERCEPTORS
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".out-interceptors

List of string

 

The comma-separated list of OutInterceptor classes

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__OUT_INTERCEPTORS
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".out-fault-interceptors

List of string

 

The comma-separated list of OutFaultInterceptor classes

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__OUT_FAULT_INTERCEPTORS
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".in-fault-interceptors

List of string

 

The comma-separated list of InFaultInterceptor classes

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__IN_FAULT_INTERCEPTORS
Since Quarkus CXF: 1.0.0

quarkus.cxf.endpoint."/endpoint-path".schema-validation.enabled-for

in, request, out, response, both, none

 

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 @org.apache.cxf.annotations.SchemaValidation or @org.apache.cxf.annotations.EndpointProperty(key = "schema-validation-enabled", value = "true") annotations.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SCHEMA_VALIDATION_ENABLED_FOR
Since Quarkus CXF: 2.7.0

quarkus.cxf.client."client-name".wsdl

string

 

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__WSDL
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".soap-binding

string

 

The URL of the SOAP Binding, should be one of four values:

  • http://schemas.xmlsoap.org/wsdl/soap/http for SOAP11HTTP_BINDING
  • http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true for SOAP11HTTP_MTOM_BINDING
  • http://www.w3.org/2003/05/soap/bindings/HTTP/ for SOAP12HTTP_BINDING
  • http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true for SOAP12HTTP_MTOM_BINDING

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SOAP_BINDING
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".client-endpoint-url

string

 

The client endpoint URL

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__CLIENT_ENDPOINT_URL
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".endpoint-namespace

string

 

The client endpoint namespace

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__ENDPOINT_NAMESPACE
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".endpoint-name

string

 

The client endpoint name

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__ENDPOINT_NAME
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".username

string

 

The username for HTTP Basic authentication

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__USERNAME
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".password

string

 

The password for HTTP Basic authentication

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__PASSWORD
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".secure-wsdl-access

boolean

false

If true, then the Authentication header will be sent preemptively when requesting the WSDL, as long as the username is set; otherwise the WSDL will be requested anonymously.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURE_WSDL_ACCESS
Since Quarkus CXF: 2.7.0

quarkus.cxf.client."client-name".logging.enabled

true, false, pretty

 

If true or pretty, the message logging will be enabled; otherwise it will not be enabled. If the value is pretty (since 2.7.0), the pretty attribute will effectively be set to true. The default is given by quarkus.cxf.logging.enabled-for.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_ENABLED
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.pretty

boolean

 

If true, the XML elements will be indented in the log; otherwise they will appear unindented. The default is given by quarkus.cxf.logging.pretty

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_PRETTY
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.limit

int

 

A message length in bytes at which it is truncated in the log. The default is given by quarkus.cxf.logging.limit

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_LIMIT
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.in-mem-threshold

long

 

A message length in bytes at which it will be written to disk. -1 is unlimited. The default is given by quarkus.cxf.logging.in-mem-threshold

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_IN_MEM_THRESHOLD
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.log-binary

boolean

 

If true, binary payloads will be logged; otherwise they won’t be logged. The default is given by quarkus.cxf.logging.log-binary

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_LOG_BINARY
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.log-multipart

boolean

 

If true, multipart payloads will be logged; otherwise they won’t be logged. The default is given by quarkus.cxf.logging.log-multipart

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_LOG_MULTIPART
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.verbose

boolean

 

If true, verbose logging will be enabled; otherwise it won’t be enabled. The default is given by quarkus.cxf.logging.verbose

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_VERBOSE
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.in-binary-content-media-types

List of string

 

A comma separated list of additional binary media types to add to the default values in the LoggingInInterceptor whose content will not be logged unless log-binary is true. The default is given by quarkus.cxf.logging.in-binary-content-media-types

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_IN_BINARY_CONTENT_MEDIA_TYPES
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.out-binary-content-media-types

List of string

 

A comma separated list of additional binary media types to add to the default values in the LoggingOutInterceptor whose content will not be logged unless log-binary is true. The default is given by quarkus.cxf.logging.out-binary-content-media-types

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_OUT_BINARY_CONTENT_MEDIA_TYPES
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.binary-content-media-types

List of string

 

A comma separated list of additional binary media types to add to the default values in the LoggingOutInterceptor and LoggingInInterceptor whose content will not be logged unless log-binary is true. The default is given by quarkus.cxf.logging.binary-content-media-types

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_BINARY_CONTENT_MEDIA_TYPES
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.sensitive-element-names

List of string

 

A comma separated list of XML elements containing sensitive information to be masked in the log. The default is given by quarkus.cxf.logging.sensitive-element-names

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_SENSITIVE_ELEMENT_NAMES
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".logging.sensitive-protocol-header-names

List of string

 

A comma separated list of protocol headers containing sensitive information to be masked in the log. The default is given by quarkus.cxf.logging.sensitive-protocol-header-names

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__LOGGING_SENSITIVE_PROTOCOL_HEADER_NAMES
Since Quarkus CXF: 2.6.0

quarkus.cxf.client."client-name".features

List of string

 

A comma-separated list of fully qualified CXF Feature class names.

Example:

quarkus.cxf.endpoint."/my-endpoint".features = org.apache.cxf.ext.logging.LoggingFeature
Copy to Clipboard Toggle word wrap

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__FEATURES
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".handlers

List of string

 

The comma-separated list of Handler classes

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__HANDLERS
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".in-interceptors

List of string

 

The comma-separated list of InInterceptor classes

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__IN_INTERCEPTORS
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".out-interceptors

List of string

 

The comma-separated list of OutInterceptor classes

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__OUT_INTERCEPTORS
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".out-fault-interceptors

List of string

 

The comma-separated list of OutFaultInterceptor classes

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__OUT_FAULT_INTERCEPTORS
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".in-fault-interceptors

List of string

 

The comma-separated list of InFaultInterceptor classes

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__IN_FAULT_INTERCEPTORS
Since Quarkus CXF: 1.0.0

quarkus.cxf.client."client-name".connection-timeout

long

30000

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__CONNECTION_TIMEOUT
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".receive-timeout

long

60000

Specifies the amount of time, in milliseconds, that the consumer will wait for a response before it times out. 0 is infinite.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__RECEIVE_TIMEOUT
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".connection-request-timeout

long

60000

Specifies the amount of time, in milliseconds, used when requesting a connection from the connection manager(if appliable). 0 is infinite.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__CONNECTION_REQUEST_TIMEOUT
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".auto-redirect

boolean

false

Specifies if the consumer will automatically follow a server issued redirection. (name is not part of standard)

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__AUTO_REDIRECT
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".max-retransmits

int

-1

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__MAX_RETRANSMITS
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".allow-chunking

boolean

true

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__ALLOW_CHUNKING
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".chunking-threshold

int

4096

If AllowChunking is true, this sets the threshold at which messages start getting chunked. Messages under this limit do not get chunked.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__CHUNKING_THRESHOLD
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".chunk-length

int

-1

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__CHUNK_LENGTH
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".accept

string

 

Specifies the MIME types the client is prepared to handle (e.g., HTML, JPEG, GIF, etc.)

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__ACCEPT
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".accept-language

string

 

Specifies the language the client desires (e.g., English, French, etc.)

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__ACCEPT_LANGUAGE
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".accept-encoding

string

 

Specifies the encoding the client is prepared to handle (e.g., gzip)

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__ACCEPT_ENCODING
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".content-type

string

 

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__CONTENT_TYPE
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".host

string

 

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__HOST
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".connection

close, keep-alive

keep-alive

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__CONNECTION
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".cache-control

string

 

Most commonly used to specify no-cache, however the standard supports a dozen or so caching related directives for requests

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__CACHE_CONTROL
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".version

string

auto

HTTP Version used for the connection. The default value auto will use whatever the default is for the HTTPConduit implementation defined via quarkus.cxf.client."client-name".http-conduit-factory. Other possible values: 1.1, 2.

Some of these values might be unsupported by some HTTPConduit implementations.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__VERSION
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".browser-type

string

 

The value of the User-Agent HTTP header.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__BROWSER_TYPE
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".decoupled-endpoint

string

 

An URI path (starting with /) or a full URI for the receipt of responses over a separate provider → consumer connection. If the value starts with /, then it is prefixed with the base URI configured via quarkus.cxf.client."client-name".decoupled-endpoint-base before being used as a value for the WS-Addressing ReplyTo message header.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__DECOUPLED_ENDPOINT
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".proxy-server

string

 

Specifies the address of proxy server if one is used.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__PROXY_SERVER
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".proxy-server-port

int

 

Specifies the port number used by the proxy server.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__PROXY_SERVER_PORT
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".non-proxy-hosts

string

 

Specifies the list of hostnames that will not use the proxy configuration. Examples:

  • localhost - a single hostname
  • localhost|www.google.com - two hostnames that will not use the proxy configuration
  • localhost|www.google.*|*.apache.org - hostname patterns

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__NON_PROXY_HOSTS
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".proxy-server-type

http, socks

http

Specifies the type of the proxy server. Can be either HTTP or SOCKS.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__PROXY_SERVER_TYPE
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".proxy-username

string

 

Username for the proxy authentication

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__PROXY_USERNAME
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".proxy-password

string

 

Password for the proxy authentication

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__PROXY_PASSWORD
Since Quarkus CXF: 2.2.3

quarkus.cxf.client."client-name".http-conduit-factory

QuarkusCXFDefault, CXFDefault, VertxHttpClientHTTPConduitFactory, HttpClientHTTPConduitFactory, URLConnectionHTTPConduitFactory

 

Select the HTTPConduitFactory implementation for this client.

  • QuarkusCXFDefault (default): if io.quarkiverse.cxf:quarkus-cxf-rt-transports-http-hc5 is present in class path, then its HTTPConduitFactory implementation will be used; otherwise this value is equivalent with URLConnectionHTTPConduitFactory (this may change, once issue #992 gets resolved in CXF)
  • CXFDefault: the selection of HTTPConduitFactory implementation is left to CXF
  • VertxHttpClientHTTPConduitFactory: (Experimental) the HTTPConduitFactory for this client will be set to an implementation always returning io.quarkiverse.cxf.vertx.http.client.VertxHttpClientHTTPConduit. This will use io.vertx.core.http.HttpClient as the underlying HTTP client. Since Quarkus CXF 3.13.0.
  • HttpClientHTTPConduitFactory: the HTTPConduitFactory for this client will be set to an implementation always returning org.apache.cxf.transport.http.HttpClientHTTPConduit. This will use java.net.http.HttpClient as the underlying HTTP client.
  • URLConnectionHTTPConduitFactory: the HTTPConduitFactory for this client will be set to an implementation always returning org.apache.cxf.transport.http.URLConnectionHTTPConduit. This will use java.net.HttpURLConnection as the underlying HTTP client.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__HTTP_CONDUIT_FACTORY
Since Quarkus CXF: 2.3.0

quarkus.cxf.client."client-name".key-store

string

 

The key store location for this client. The resource is first looked up in the classpath, then in the file system.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__KEY_STORE
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".key-store-password

string

 

The key store password

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__KEY_STORE_PASSWORD
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".key-store-type

string

JKS

The type of the key store.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__KEY_STORE_TYPE
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".key-password

string

 

The key password.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__KEY_PASSWORD
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".trust-store

string

 

The trust store location for this client. The resource is first looked up in the classpath, then in the file system.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__TRUST_STORE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".trust-store-password

string

 

The trust store password.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__TRUST_STORE_PASSWORD
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".trust-store-type

string

JKS

The type of the trust store.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__TRUST_STORE_TYPE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".hostname-verifier

string

 

Can be one of the following:

  • One of the well known values: AllowAllHostnameVerifier, HttpsURLConnectionDefaultHostnameVerifier
  • A fully qualified class name implementing javax.net.ssl.HostnameVerifier to look up in the CDI container.
  • A bean name prefixed with # that will be looked up in the CDI container; example: #myHostnameVerifier If not specified, then the creation of the HostnameVerifier is delegated to CXF, which boils down to org.apache.cxf.transport.https.httpclient.DefaultHostnameVerifier with the default org.apache.cxf.transport.https.httpclient.PublicSuffixMatcherLoader as returned from PublicSuffixMatcherLoader.getDefault().

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__HOSTNAME_VERIFIER
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".schema-validation.enabled-for

in, request, out, response, both, none

 

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 @org.apache.cxf.annotations.SchemaValidation or @org.apache.cxf.annotations.EndpointProperty(key = "schema-validation-enabled", value = "true") annotations.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SCHEMA_VALIDATION_ENABLED_FOR
Since Quarkus CXF: 2.7.0

4.2. Metrics Feature

Collect metrics using Micrometer.

Important

Unlike CXF Metrics feature, this Quarkus CXF extension does not support Dropwizard Metrics. Only Micrometer is supported.

4.2.1. Maven coordinates

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>
Copy to Clipboard Toggle word wrap

4.2.2. Usage

The integration of CXF into the Quarkus Micrometer ecosystem is implemented using io.quarkiverse.cxf.metrics.QuarkusCxfMetricsFeature. As long as your application depends on quarkus-cxf-rt-features-metrics, an instance of QuarkusCxfMetricsFeature is created internally and enabled by default for all clients and service endpoints created by Quarkus CXF. You can disable it via quarkus.cxf.metrics.enabled-for, quarkus.cxf.client."client-name".metrics.enabled and quarkus.cxf.endpoint."/endpoint-path".metrics.enabled properties documented below.

4.2.2.1. Runnable example

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>
Copy to Clipboard Toggle word wrap

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>
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

Having all the above in place, you can start the application in Dev mode:

$ mvn quarkus:dev
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

After that, you should see some metrics under cxf.server.requests in the output of the endpoint you configured above:

$ curl http://localhost:8080/q/metrics/json
metrics: {
    ...
    "cxf.server.requests": {
        "count;exception=None;faultCode=None;method=POST;operation=hello;outcome=SUCCESS;status=200;uri=/soap/hello": 2,
        "elapsedTime;exception=None;faultCode=None;method=POST;operation=hello;outcome=SUCCESS;status=200;uri=/soap/hello": 64.0
    },
    ...
}
Copy to Clipboard Toggle word wrap

4.2.3. Configuration

lock Configuration property fixed at build time. All other configuration properties are overridable at runtime.

Expand
Configuration propertyTypeDefault

quarkus.cxf.metrics.enabled-for

clients, services, both, none

both

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 quarkus.cxf.client."client-name".metrics.enabled or quarkus.cxf.endpoint."/endpoint-path".metrics.enabled option respectively.

Environment variable: QUARKUS_CXF_METRICS_ENABLED_FOR
Since Quarkus CXF: 2.7.0

quarkus.cxf.metrics.tags-customizers

List of string

 

A list of references to org.apache.cxf.metrics.micrometer.provider.TagsCustomizer beans that will be attached to the global metrics feature.

Environment variable: QUARKUS_CXF_METRICS_TAGS_CUSTOMIZERS
Since Quarkus CXF: 3.15.0

quarkus.cxf.client."client-name".metrics.enabled

boolean

true

If true and if quarkus.cxf.metrics.enabled-for is set to both or clients then the MetricsFeature will be added to this client; otherwise the feature will not be added to this client.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__METRICS_ENABLED
Since Quarkus CXF: 2.7.0

quarkus.cxf.endpoint."/endpoint-path".metrics.enabled

boolean

true

If true and if quarkus.cxf.metrics.enabled-for is set to both or services then the MetricsFeature will be added to this service endpoint; otherwise the feature will not be added to this service endpoint.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__METRICS_ENABLED
Since Quarkus CXF: 2.7.0

4.3. OpenTelemetry

Generate OpenTelemetry traces.

Important

OpenTelemetry Metrics and Logging are not supported yet on neither Quarkus nor CXF side, hence Quarkus CXF cannot support them either. Tracing is thus the only OpenTelemetry feature supported by this extension.

4.3.1. Maven coordinates

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>
Copy to Clipboard Toggle word wrap

4.3.2. Usage

This extension builds on top of org.apache.cxf.tracing.opentelemetry.OpenTelemetryFeature (for service endpoints) and org.apache.cxf.tracing.opentelemetry.OpenTelemetryClientFeature (for clients). Instances of these are created and configured internally using the instance of io.opentelemetry.api.OpenTelemetry provided by Quarkus OpenTelemetry.

The tracing is enabled by default for all clients and service endpoints created by Quarkus CXF, unless you disable it explicitly via quarkus.cxf.otel.enabled-for, quarkus.cxf.client."client-name".otel.enabled or quarkus.cxf.endpoint."/endpoint-path".otel.enabled.

4.3.2.1. Runnable example

There is an integration test covering OpenTelemetry in the Quarkus CXF source tree. It is using InMemorySpanExporter from io.opentelemetry:opentelemetry-sdk-testing, so that the spans can be inspected from tests easily. Refer to Quarkus OpenTelemetry guide for information about other supported span exporters and collectors.

4.3.3. Configuration

lock Configuration property fixed at build time. All other configuration properties are overridable at runtime.

Expand
Configuration propertyTypeDefault

quarkus.cxf.otel.enabled-for

clients, services, both, none

both

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 quarkus.cxf.client."client-name".otel.enabled or quarkus.cxf.endpoint."/endpoint-path".otel.enabled option respectively.

quarkus.otel.enabled and quarkus.otel.sdk.disabled also impact whether the CXF telemetry data is collected. Check Quarkus OpenTelemetry guide.

Environment variable: QUARKUS_CXF_OTEL_ENABLED_FOR
Since Quarkus CXF: 2.7.0

quarkus.cxf.client."client-name".otel.enabled

boolean

true

If true and if quarkus.cxf.otel.enabled-for is set to both or clients then the OpenTelemetryClientFeature will be added to this client; otherwise the feature will not be added to this client.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__OTEL_ENABLED
Since Quarkus CXF: 2.7.0

quarkus.cxf.endpoint."/endpoint-path".otel.enabled

boolean

true

If true and if quarkus.cxf.otel.enabled-for is set to both or services then the OpenTelemetryFeature will be added to this service endpoint; otherwise the feature will not be added to this service endpoint.

quarkus.otel.enabled and quarkus.otel.sdk.disabled also impact whether the CXF telemetry data is collected. Check Quarkus OpenTelemetry guide.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__OTEL_ENABLED
Since Quarkus CXF: 2.7.0

4.4. WS-Security

Provides CXF framework’s WS-Security implementation allowing you to:

  • Pass authentication tokens between services
  • Encrypt messages or parts of messages
  • Sign messages
  • Timestamp messages

4.4.1. Maven coordinates

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>
Copy to Clipboard Toggle word wrap

4.4.2. Supported standards

4.4.3. Usage

The CXF framework’s WS-Security (WSS) implementation is based on WSS4J. It can be activated in two ways:

  • By using WS-SecurityPolicy
  • By adding WSS4J interceptors to your clients and service endpoints.

WS-SecurityPolicy is preferable because in that way, the security requirements become a part of the WSDL contract. That in turn greatly simplifies not only the implementation of clients and service endpoints but also the interoperability between vendors.

Nevertheless, if you leverage WS-SecurityPolicy, CXF sets up the WSS4J interceptors under the hood for you.

We won’t explain the manual approach with WSS4J interceptors in detail here, but you can still refer to our WS-Security integration test as an example.

4.4.3.1. WS-Security via WS-SecurityPolicy
Tip

The sample code snippets used in this section come from the WS-SecurityPolicy integration test in the source tree of Quarkus CXF

Let’s say our aim is to ensure that the communication between the client and service is confidential (through encryption) and that the message has not been tampered with (through digital signatures). We also want to assure that the clients are who they claim to be by authenticating themselves by X.509 certificates.

We can express all these requirements in a single WS-SecurityPolicy document:

encrypt-sign-policy.xml

<?xml version="1.0" encoding="UTF-8" ?>
<wsp:Policy wsu:Id="SecurityServiceEncryptThenSignPolicy"
    xmlns:wsp="http://www.w3.org/ns/ws-policy"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
    <wsp:ExactlyOne>
        <wsp:All>
            
1

            <sp:AsymmetricBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                <wsp:Policy>
                    
2

                    <sp:InitiatorToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
                                <wsp:Policy>
                                    <sp:WssX509V3Token11/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:InitiatorToken>
                    <sp:RecipientToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
                                <wsp:Policy>
                                    <sp:WssX509V3Token11/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:RecipientToken>
                    <sp:AlgorithmSuite>
                        <wsp:Policy>
                            <sp:Basic256/>
                        </wsp:Policy>
                    </sp:AlgorithmSuite>
                    <sp:Layout>
                        <wsp:Policy>
                            <sp:Strict/>
                        </wsp:Policy>
                    </sp:Layout>
                    <sp:IncludeTimestamp/>
                    <sp:ProtectTokens/>
                    <sp:OnlySignEntireHeadersAndBody/>
                    <sp:EncryptBeforeSigning/>
                </wsp:Policy>
            </sp:AsymmetricBinding>
            
3

            <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                <sp:Body/>
            </sp:SignedParts>
            
4

            <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                <sp:Body/>
            </sp:EncryptedParts>
            <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                <wsp:Policy>
                    <sp:MustSupportRefIssuerSerial/>
                </wsp:Policy>
            </sp:Wss10>
        </wsp:All>
    </wsp:ExactlyOne>
</wsp:Policy>
Copy to Clipboard Toggle word wrap

1
AsymmetricBinding specifies the use of asymmetric (public/private key) cryptography for securing the communication between two parties
2
InitiatorToken indicates that the initiator (sender) of the message will use an X.509 certificate token that must always be provided to the recipient.
3
SignedParts specifies which parts of the SOAP message must be signed to ensure their integrity.
4
EncryptedParts specifies the parts of the SOAP message that must be encrypted to ensure their confidentiality.

We set this policy on the Service Endpoint Interface (SEI) EncryptSignPolicyHelloService using @org.apache.cxf.annotations.Policy annotation:

EncryptSignPolicyHelloService.java

@WebService(serviceName = "EncryptSignPolicyHelloService")
@Policy(placement = Policy.Placement.BINDING, uri = "encrypt-sign-policy.xml")
public interface EncryptSignPolicyHelloService extends AbstractHelloService {
...
}
Copy to Clipboard Toggle word wrap

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

# A service with encrypt-sign-policy.xml set
quarkus.cxf.endpoint."/helloEncryptSign".implementor = io.quarkiverse.cxf.it.security.policy.EncryptSignPolicyHelloServiceImpl
# Signature settings
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.username = bob
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.password = bob-keystore-password
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.type" = pkcs12
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.password" = bob-keystore-password
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.alias" = bob
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.properties."org.apache.ws.security.crypto.merlin.file" = bob-keystore.pkcs12
# Encryption settings
quarkus.cxf.endpoint."/helloEncryptSign".security.encryption.username = alice
quarkus.cxf.endpoint."/helloEncryptSign".security.encryption.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin
quarkus.cxf.endpoint."/helloEncryptSign".security.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.type" = pkcs12
quarkus.cxf.endpoint."/helloEncryptSign".security.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.password" = bob-keystore-password
quarkus.cxf.endpoint."/helloEncryptSign".security.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.alias" = bob
quarkus.cxf.endpoint."/helloEncryptSign".security.encryption.properties."org.apache.ws.security.crypto.merlin.file" = bob-keystore.pkcs12
Copy to Clipboard Toggle word wrap

Similar setup is necessary on the client side:

application.properties

# A client with encrypt-sign-policy.xml set
quarkus.cxf.client.helloEncryptSign.client-endpoint-url = https://localhost:${quarkus.http.test-ssl-port}/services/helloEncryptSign
quarkus.cxf.client.helloEncryptSign.service-interface = io.quarkiverse.cxf.it.security.policy.EncryptSignPolicyHelloService
quarkus.cxf.client.helloEncryptSign.features = #messageCollector
# The client-endpoint-url above is HTTPS, so we have to setup the server's SSL certificates
quarkus.cxf.client.helloEncryptSign.trust-store = client-truststore.pkcs12
quarkus.cxf.client.helloEncryptSign.trust-store-password = client-truststore-password
# Signature settings
quarkus.cxf.client.helloEncryptSign.security.signature.username = alice
quarkus.cxf.client.helloEncryptSign.security.signature.password = alice-keystore-password
quarkus.cxf.client.helloEncryptSign.security.signature.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin
quarkus.cxf.client.helloEncryptSign.security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.type" = pkcs12
quarkus.cxf.client.helloEncryptSign.security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.password" = alice-keystore-password
quarkus.cxf.client.helloEncryptSign.security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.alias" = alice
quarkus.cxf.client.helloEncryptSign.security.signature.properties."org.apache.ws.security.crypto.merlin.file" = alice-keystore.pkcs12
# Encryption settings
quarkus.cxf.client.helloEncryptSign.security.encryption.username = bob
quarkus.cxf.client.helloEncryptSign.security.encryption.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin
quarkus.cxf.client.helloEncryptSign.security.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.type" = pkcs12
quarkus.cxf.client.helloEncryptSign.security.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.password" = alice-keystore-password
quarkus.cxf.client.helloEncryptSign.security.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.alias" = alice
quarkus.cxf.client.helloEncryptSign.security.encryption.properties."org.apache.ws.security.crypto.merlin.file" = alice-keystore.pkcs12
Copy to Clipboard Toggle word wrap

To inspect the flow of the messages, you can execute the EncryptSignPolicyTest as follows:

# Clone the repository
$ git clone https://github.com/quarkiverse/quarkus-cxf.git -o upstream
$ cd quarkus-cxf
# Build the whole source tree
$ mvn clean install -DskipTests -Dquarkus.build.skip
# Run the test
$ cd integration-tests/ws-security-policy
$ mvn clean test -Dtest=EncryptSignPolicyTest
Copy to Clipboard Toggle word wrap

You should see some messages containing Signature elements and encrypted bodies in the console output.

4.4.4. Configuration

lock Configuration property fixed at build time. All other configuration properties are overridable at runtime.

Expand
Configuration propertyTypeDefault

quarkus.cxf.client."client-name".security.username

string

 

The user’s name. It is used as follows:

  • As the name in the UsernameToken for WS-Security
  • As the alias name in the keystore to get the user’s cert and private key for signature if signature.username is not set
  • As the alias name in the keystore to get the user’s public key for encryption if encryption.username is not set

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_USERNAME
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.password

string

 

The user’s password when a callback-handler is not defined. This is only used for the password in a WS-Security UsernameToken.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_PASSWORD
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.signature.username

string

 

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 username is used instead. If that is also not specified, it uses the the default alias set in the properties file referenced by signature.properties. If that’s also not set, and the keystore only contains a single key, that key will be used.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SIGNATURE_USERNAME
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.signature.password

string

 

The user’s password for signature when a callback-handler is not defined.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SIGNATURE_PASSWORD
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.encryption.username

string

 

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 username is used instead. If that is also not specified, it uses the the default alias set in the properties file referenced by encrypt.properties. If that’s also not set, and the keystore only contains a single key, that key will be used.

For the WS-Security web service provider, the useReqSigCert value can be used to accept (encrypt to) any client whose public key is in the service’s truststore (defined in encrypt.properties).

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENCRYPTION_USERNAME
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.callback-handler

string

 

A reference to a javax.security.auth.callback.CallbackHandler bean used to obtain passwords, for both outbound and inbound requests.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CALLBACK_HANDLER
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.saml-callback-handler

string

 

A reference to a javax.security.auth.callback.CallbackHandler implementation used to construct SAML Assertions.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SAML_CALLBACK_HANDLER
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.signature.properties."signature-properties"

Map<String,String>

 

The Crypto property configuration to use for signing, if signature.crypto is not set.

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
Copy to Clipboard Toggle word wrap

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SIGNATURE_PROPERTIES__SIGNATURE_PROPERTIES_
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.encryption.properties."encryption-properties"

Map<String,String>

 

The Crypto property configuration to use for encryption, if encryption.crypto is not set.

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
Copy to Clipboard Toggle word wrap

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENCRYPTION_PROPERTIES__ENCRYPTION_PROPERTIES_
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.signature.crypto

string

 

A reference to a org.apache.wss4j.common.crypto.Crypto bean to be used for signature. If not set, signature.properties will be used to configure a Crypto instance.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SIGNATURE_CRYPTO
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.encryption.crypto

string

 

A reference to a org.apache.wss4j.common.crypto.Crypto to be used for encryption. If not set, encryption.properties will be used to configure a Crypto instance.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENCRYPTION_CRYPTO
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.encryption.certificate

string

 

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 encryption.properties or extracted from request (when WS-Security is used and if encryption.username has value useReqSigCert.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENCRYPTION_CERTIFICATE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.enable-revocation

boolean

false

If true, Certificate Revocation List (CRL) checking is enabled when verifying trust in a certificate; otherwise it is not enabled.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENABLE_REVOCATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.enable-unsigned-saml-assertion-principal

boolean

false

If true, unsigned SAML assertions will be allowed as SecurityContext Principals; otherwise they won’t be allowed as SecurityContext Principals.

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENABLE_UNSIGNED_SAML_ASSERTION_PRINCIPAL
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.validate-saml-subject-confirmation

boolean

true

If true, the SubjectConfirmation requirements of a received SAML Token (sender-vouches or holder-of-key) will be validated; otherwise they won’t be validated.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_VALIDATE_SAML_SUBJECT_CONFIRMATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.sc-from-jaas-subject

boolean

true

If true, security context can be created from JAAS Subject; otherwise it must not be created from JAAS Subject.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SC_FROM_JAAS_SUBJECT
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.audience-restriction-validation

boolean

true

If true, then if the SAML Token contains Audience Restriction URIs, one of them must match one of the values in audience.restrictions; otherwise the SAML AudienceRestriction validation is disabled.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_AUDIENCE_RESTRICTION_VALIDATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.saml-role-attributename

string

http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role

The attribute URI of the SAML AttributeStatement where the role information is stored.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SAML_ROLE_ATTRIBUTENAME
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.subject-cert-constraints

string

 

A String of regular expressions (separated by the value specified in security.cert.constraints.separator) which will be applied to the subject DN of the certificate used for signature validation, after trust verification of the certificate chain associated with the certificate.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SUBJECT_CERT_CONSTRAINTS
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.cert-constraints-separator

string

,

The separator that is used to parse certificate constraints configured in security.subject.cert.constraints

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CERT_CONSTRAINTS_SEPARATOR
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.actor

string

 

The actor or role name of the wsse:Security header. If this parameter is omitted, the actor name is not set.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ACTOR
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.validate.token

boolean

true

If true, the password of a received UsernameToken will be validated; otherwise it won’t be validated.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_VALIDATE_TOKEN
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.username-token.always.encrypted

boolean

true

Whether to always encrypt UsernameTokens that are defined as a SupportingToken. This should not be set to false in a production environment, as it exposes the password (or the digest of the password) on the wire.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_USERNAME_TOKEN_ALWAYS_ENCRYPTED
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.is-bsp-compliant

boolean

true

If true, the compliance with the Basic Security Profile (BSP) 1.1 will be ensured; otherwise it will not be ensured.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_IS_BSP_COMPLIANT
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.enable.nonce.cache

boolean

 

If true, the UsernameToken nonces will be cached for both message initiators and recipients; otherwise they won’t be cached for neither message initiators nor recipients. The default is true for message recipients, and false for message initiators.

Caching

Caching only applies when either a UsernameToken WS-SecurityPolicy is in effect, or the UsernameToken action has been configured for the non-security-policy case.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENABLE_NONCE_CACHE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.enable.timestamp.cache

boolean

 

If true, the Timestamp Created Strings (these are only cached in conjunction with a message Signature) will be cached for both message initiators and recipients; otherwise they won’t be cached for neither message initiators nor recipients. The default is true for message recipients, and false for message initiators.

Caching

Caching only applies when either a IncludeTimestamp policy is in effect, or the Timestamp action has been configured for the non-security-policy case.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENABLE_TIMESTAMP_CACHE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.enable.streaming

boolean

false

If true, the new streaming (StAX) implementation of WS-Security is used; otherwise the old DOM implementation is used.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENABLE_STREAMING
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.return.security.error

boolean

false

If true, detailed security error messages are sent to clients; otherwise the details are omitted and only a generic error message is sent.

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_RETURN_SECURITY_ERROR
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.must-understand

boolean

true

If true, the SOAP mustUnderstand header is included in security headers based on a WS-SecurityPolicy; otherwise the header is always omitted.

Works only with enable.streaming = true - see CXF-8940

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_MUST_UNDERSTAND
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.enable.saml.cache

boolean

 

If true and in case the token contains a OneTimeUse Condition, the SAML2 Token Identifiers will be cached for both message initiators and recipients; otherwise they won’t be cached for neither message initiators nor recipients. The default is true for message recipients, and false for message initiators.

Caching only applies when either a SamlToken policy is in effect, or a SAML action has been configured for the non-security-policy case.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ENABLE_SAML_CACHE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.store.bytes.in.attachment

boolean

 

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STORE_BYTES_IN_ATTACHMENT
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.swa.encryption.attachment.transform.content

boolean

false

If true, Attachment-Content-Only transform will be used when an Attachment is encrypted via a WS-SecurityPolicy expression; otherwise Attachment-Complete transform will be used when an Attachment is encrypted via a WS-SecurityPolicy expression.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SWA_ENCRYPTION_ATTACHMENT_TRANSFORM_CONTENT
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.use.str.transform

boolean

true

If true, the STR (Security Token Reference) Transform will be used when (externally) signing a SAML Token; otherwise the STR (Security Token Reference) Transform will not be used.

Some frameworks cannot process the SecurityTokenReference. You may set this false in such cases.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_USE_STR_TRANSFORM
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.add.inclusive.prefixes

boolean

true

If true, an InclusiveNamespaces PrefixList will be added as a CanonicalizationMethod child when generating Signatures using WSConstants.C14N_EXCL_OMIT_COMMENTS; otherwise the PrefixList will not be added.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ADD_INCLUSIVE_PREFIXES
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.disable.require.client.cert.check

boolean

false

If true, the enforcement of the WS-SecurityPolicy RequireClientCertificate policy will be disabled; otherwise the enforcement of the WS-SecurityPolicy RequireClientCertificate policy is enabled.

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_DISABLE_REQUIRE_CLIENT_CERT_CHECK
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.expand.xop.include

boolean

 

If true, the xop:Include elements will be searched for encryption and signature (on the outbound side) or for signature verification (on the inbound side); otherwise the search won’t happen. This ensures that the actual bytes are signed, and not just the reference. The default is true if MTOM is enabled, otherwise the default is false.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_EXPAND_XOP_INCLUDE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.timestamp.timeToLive

string

300

The time in seconds to add to the Creation value of an incoming Timestamp to determine whether to accept it as valid or not.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_TIMESTAMP_TIMETOLIVE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.timestamp.futureTimeToLive

string

60

The time in seconds in the future within which the Created time of an incoming Timestamp is valid. The default is greater than zero to avoid problems where clocks are slightly askew. Set this to 0 to reject all future-created `Timestamp`s.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_TIMESTAMP_FUTURETIMETOLIVE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.usernametoken.timeToLive

string

300

The time in seconds to append to the Creation value of an incoming UsernameToken to determine whether to accept it as valid or not.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_USERNAMETOKEN_TIMETOLIVE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.usernametoken.futureTimeToLive

string

60

The time in seconds in the future within which the Created time of an incoming UsernameToken is valid. The default is greater than zero to avoid problems where clocks are slightly askew. Set this to 0 to reject all future-created `UsernameToken`s.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_USERNAMETOKEN_FUTURETIMETOLIVE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.spnego.client.action

string

 

A reference to a org.apache.wss4j.common.spnego.SpnegoClientAction bean to use for SPNEGO. This allows the user to plug in a different implementation to obtain a service ticket.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SPNEGO_CLIENT_ACTION
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.nonce.cache.instance

string

 

A reference to a org.apache.wss4j.common.cache.ReplayCache bean used to cache UsernameToken nonces. A org.apache.wss4j.common.cache.EHCacheReplayCache instance is used by default.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_NONCE_CACHE_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.timestamp.cache.instance

string

 

A reference to a org.apache.wss4j.common.cache.ReplayCache bean used to cache Timestamp Created Strings. A org.apache.wss4j.common.cache.EHCacheReplayCache instance is used by default.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_TIMESTAMP_CACHE_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.saml.cache.instance

string

 

A reference to a org.apache.wss4j.common.cache.ReplayCache bean used to cache SAML2 Token Identifier Strings (if the token contains a OneTimeUse condition). A org.apache.wss4j.common.cache.EHCacheReplayCache instance is used by default.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SAML_CACHE_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.cache.config.file

string

 

Set this property to point to a configuration file for the underlying caching implementation for the TokenStore. The default configuration file that is used is cxf-ehcache.xml in org.apache.cxf:cxf-rt-security JAR.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CACHE_CONFIG_FILE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.token-store-cache-instance

string

 

A reference to a org.apache.cxf.ws.security.tokenstore.TokenStore bean to use for caching security tokens. By default this uses a instance.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_TOKEN_STORE_CACHE_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.cache.identifier

string

 

The Cache Identifier to use with the TokenStore. CXF uses the following key to retrieve a token store: org.apache.cxf.ws.security.tokenstore.TokenStore-<identifier>. This key can be used to configure service-specific cache configuration. If the identifier does not match, then it falls back to a cache configuration with key org.apache.cxf.ws.security.tokenstore.TokenStore.

The default <identifier> is the QName of the service in question. However to pick up a custom cache configuration (for example, if you want to specify a TokenStore per-client proxy), it can be configured with this identifier instead.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CACHE_IDENTIFIER
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.role.classifier

string

 

The Subject Role Classifier to use. If one of the WSS4J Validators returns a JAAS Subject from Validation, then the WSS4JInInterceptor will attempt to create a SecurityContext based on this Subject. If this value is not specified, then it tries to get roles using the DefaultSecurityContext in org.apache.cxf:cxf-core. Otherwise it uses this value in combination with the role.classifier.type to get the roles from the Subject.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ROLE_CLASSIFIER
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.role.classifier.type

string

prefix

The Subject Role Classifier Type to use. If one of the WSS4J Validators returns a JAAS Subject from Validation, then the WSS4JInInterceptor will attempt to create a SecurityContext based on this Subject. Currently accepted values are prefix or classname. Must be used in conjunction with the role.classifier.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ROLE_CLASSIFIER_TYPE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.asymmetric.signature.algorithm

string

 

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_ASYMMETRIC_SIGNATURE_ALGORITHM
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.symmetric.signature.algorithm

string

 

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SYMMETRIC_SIGNATURE_ALGORITHM
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.password.encryptor.instance

string

 

A reference to a org.apache.wss4j.common.crypto.PasswordEncryptor bean, which is used to encrypt or decrypt passwords in the Merlin Crypto implementation (or any custom Crypto implementations).

By default, WSS4J uses the org.apache.wss4j.common.crypto.JasyptPasswordEncryptor which must be instantiated with a password to use to decrypt keystore passwords in the Merlin Crypto definition. This password is obtained via the CallbackHandler defined via callback-handler

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_PASSWORD_ENCRYPTOR_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.delegated.credential

string

 

A reference to a Kerberos org.ietf.jgss.GSSCredential bean to use for WS-Security. This is used to retrieve a service ticket instead of using the client credentials.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_DELEGATED_CREDENTIAL
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.security.context.creator

string

 

A reference to a org.apache.cxf.ws.security.wss4j.WSS4JSecurityContextCreator bean that is used to create a CXF SecurityContext from the set of WSS4J processing results. The default implementation is org.apache.cxf.ws.security.wss4j.DefaultWSS4JSecurityContextCreator.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SECURITY_CONTEXT_CREATOR
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.security.token.lifetime

long

300000

The security token lifetime value (in milliseconds).

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_SECURITY_TOKEN_LIFETIME
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.kerberos.request.credential.delegation

boolean

false

If true, credential delegation is requested in the KerberosClient; otherwise the credential delegation is not in the KerberosClient.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_KERBEROS_REQUEST_CREDENTIAL_DELEGATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.kerberos.use.credential.delegation

boolean

false

If true, GSSCredential bean is retrieved from the Message Context using the delegated.credential property and then it is used to obtain a service ticket.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_KERBEROS_USE_CREDENTIAL_DELEGATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.kerberos.is.username.in.servicename.form

boolean

false

If true, the Kerberos username is in servicename form; otherwise the Kerberos username is not in servicename form.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_KERBEROS_IS_USERNAME_IN_SERVICENAME_FORM
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.kerberos.jaas.context

string

 

The JAAS Context name to use for Kerberos.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_KERBEROS_JAAS_CONTEXT
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.kerberos.spn

string

 

The Kerberos Service Provider Name (spn) to use.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_KERBEROS_SPN
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.kerberos.client

string

 

A reference to a org.apache.cxf.ws.security.kerberos.KerberosClient bean used to obtain a service ticket.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_KERBEROS_CLIENT
Since Quarkus CXF: 2.5.0

quarkus.cxf.client."client-name".security.custom.digest.algorithm

string

http://www.w3.org/2001/04/xmlenc#sha256

The Digest Algorithm to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite, for instance

<wsp:Policy wsu:Id="SecurityServiceEncryptThenSignPolicy"
  xmlns:wsp="http://www.w3.org/ns/ws-policy"
  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
  <wsp:ExactlyOne>
    <wsp:All>
      <sp:AsymmetricBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
        <wsp:Policy>
          ...
          <sp:AlgorithmSuite>
            <wsp:Policy>
              <sp:CustomAlgorithmSuite/>
            </wsp:Policy>
          </sp:AlgorithmSuite>
          ...
        </wsp:Policy>
      </sp:AsymmetricBinding>
      ...
    </wsp:All>
  </wsp:ExactlyOne>
</wsp:Policy>
Copy to Clipboard Toggle word wrap

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_DIGEST_ALGORITHM
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.encryption.algorithm

string

http://www.w3.org/2009/xmlenc11#aes256-gcm

The Encryption Algorithm to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_ENCRYPTION_ALGORITHM
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.symmetric.key.encryption.algorithm

string

http://www.w3.org/2001/04/xmlenc#kw-aes256

The Symmetric Key Encryption Algorithm to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_SYMMETRIC_KEY_ENCRYPTION_ALGORITHM
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.asymmetric.key.encryption.algorithm

string

http://www.w3.org/2001/04/xmlenc#rsa-1_5

The Asymmetric Key Encryption Algorithm to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_ASYMMETRIC_KEY_ENCRYPTION_ALGORITHM
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.encryption.key.derivation

string

http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1

The Encryption Key Derivation to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_ENCRYPTION_KEY_DERIVATION
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.signature.key.derivation

string

http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1

The Signature Key Derivation to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_SIGNATURE_KEY_DERIVATION
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.encryption.derived.key.length

int

256

The Encryption Derived Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_ENCRYPTION_DERIVED_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.signature.derived.key.length

int

192

The Signature Derived Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_SIGNATURE_DERIVED_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.minimum.symmetric.key.length

int

256

The Minimum Symmetric Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_MINIMUM_SYMMETRIC_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.maximum.symmetric.key.length

int

256

The Maximum Symmetric Key Length to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_MAXIMUM_SYMMETRIC_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.minimum.asymmetric.key.length

int

1024

The Minimum Symmetric Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_MINIMUM_ASYMMETRIC_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.custom.maximum.asymmetric.key.length

int

4096

The Maximum Symmetric Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_CUSTOM_MAXIMUM_ASYMMETRIC_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.client."client-name".security.sts.client

string

 

A reference to a fully configured org.apache.cxf.ws.security.trust.STSClient bean to communicate with the STS. If not set, the STS client will be created and configured based on other [prefix].security.sts.client.* properties as long as they are available.

To work around the fact that org.apache.cxf.ws.security.trust.STSClient does not have a no-args constructor and cannot thus be used as a CDI bean type, you can use the wrapper class io.quarkiverse.cxf.ws.security.sts.client.STSClientBean instead.

Tip

Check the Security Token Service (STS) extension page for more information about WS-Trust.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.wsdl

string

 

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_WSDL
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.service-name

string

 

A fully qualified name of the STS service. Common values include:

  • WS-Trust 1.0: {http://schemas.xmlsoap.org/ws/2005/02/trust/}SecurityTokenService
  • WS-Trust 1.3: {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService
  • WS-Trust 1.4: {http://docs.oasis-open.org/ws-sx/ws-trust/200802/}SecurityTokenService

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_SERVICE_NAME
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.endpoint-name

string

 

A fully qualified name of the STS endpoint name. Common values include:

  • {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}X509_Port
  • {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Transport_Port
  • {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}UT_Port

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_ENDPOINT_NAME
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.username

string

 

The user name to use when authenticating against the STS. It is used as follows:

  • As the name in the UsernameToken for WS-Security
  • As the alias name in the keystore to get the user’s cert and private key for signature if signature.username is not set
  • As the alias name in the keystore to get the user’s public key for encryption if encryption.username is not set

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_USERNAME
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.password

string

 

The password associated with the username.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_PASSWORD
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.encryption.username

string

 

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 username is used instead. If that is also not specified, it uses the the default alias set in the properties file referenced by encrypt.properties. If that’s also not set, and the keystore only contains a single key, that key will be used.

For the WS-Security web service provider, the useReqSigCert value can be used to accept (encrypt to) any client whose public key is in the service’s truststore (defined in encrypt.properties).

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_ENCRYPTION_USERNAME
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.encryption.properties."encryption-properties"

Map<String,String>

 

The Crypto property configuration to use for encryption, if encryption.crypto is not set.

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
Copy to Clipboard Toggle word wrap

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_ENCRYPTION_PROPERTIES__ENCRYPTION_PROPERTIES_
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.encryption.crypto

string

 

A reference to a org.apache.wss4j.common.crypto.Crypto to be used for encryption. If not set, encryption.properties will be used to configure a Crypto instance.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_ENCRYPTION_CRYPTO
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.token.crypto

string

 

A reference to a org.apache.wss4j.common.crypto.Crypto to be used for the STS. If not set, token.properties will be used to configure a Crypto instance.

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 token.properties to send/process any RSA/DSAKeyValue tokens used if the KeyType is PublicKey

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_TOKEN_CRYPTO
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.token.properties."token-properties"

Map<String,String>

 

The Crypto property configuration to use for encryption, if encryption.crypto is not set.

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
Copy to Clipboard Toggle word wrap

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_TOKEN_PROPERTIES__TOKEN_PROPERTIES_
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.token.username

string

 

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: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_TOKEN_USERNAME
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.token.usecert

boolean

false

Whether to write out an X509Certificate structure in UseKey/KeyInfo, or whether to write out a KeyValue structure.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_TOKEN_USECERT
Since Quarkus CXF: 3.8.0

quarkus.cxf.client."client-name".security.sts.client.soap12-binding

boolean

false

If true the STS client will be set to send Soap 1.2 messages; otherwise it will send SOAP 1.1 messages.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__SECURITY_STS_CLIENT_SOAP12_BINDING
Since Quarkus CXF: 3.8.0

quarkus.cxf.endpoint."/endpoint-path".security.username

string

 

The user’s name. It is used as follows:

  • As the name in the UsernameToken for WS-Security
  • As the alias name in the keystore to get the user’s cert and private key for signature if signature.username is not set
  • As the alias name in the keystore to get the user’s public key for encryption if encryption.username is not set

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_USERNAME
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.password

string

 

The user’s password when a callback-handler is not defined. This is only used for the password in a WS-Security UsernameToken.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_PASSWORD
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.signature.username

string

 

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 username is used instead. If that is also not specified, it uses the the default alias set in the properties file referenced by signature.properties. If that’s also not set, and the keystore only contains a single key, that key will be used.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SIGNATURE_USERNAME
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.signature.password

string

 

The user’s password for signature when a callback-handler is not defined.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SIGNATURE_PASSWORD
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.encryption.username

string

 

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 username is used instead. If that is also not specified, it uses the the default alias set in the properties file referenced by encrypt.properties. If that’s also not set, and the keystore only contains a single key, that key will be used.

For the WS-Security web service provider, the useReqSigCert value can be used to accept (encrypt to) any client whose public key is in the service’s truststore (defined in encrypt.properties).

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENCRYPTION_USERNAME
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.callback-handler

string

 

A reference to a javax.security.auth.callback.CallbackHandler bean used to obtain passwords, for both outbound and inbound requests.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CALLBACK_HANDLER
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.saml-callback-handler

string

 

A reference to a javax.security.auth.callback.CallbackHandler implementation used to construct SAML Assertions.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SAML_CALLBACK_HANDLER
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.signature.properties."signature-properties"

Map<String,String>

 

The Crypto property configuration to use for signing, if signature.crypto is not set.

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
Copy to Clipboard Toggle word wrap

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SIGNATURE_PROPERTIES__SIGNATURE_PROPERTIES_
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.encryption.properties."encryption-properties"

Map<String,String>

 

The Crypto property configuration to use for encryption, if encryption.crypto is not set.

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
Copy to Clipboard Toggle word wrap

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENCRYPTION_PROPERTIES__ENCRYPTION_PROPERTIES_
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.signature.crypto

string

 

A reference to a org.apache.wss4j.common.crypto.Crypto bean to be used for signature. If not set, signature.properties will be used to configure a Crypto instance.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SIGNATURE_CRYPTO
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.encryption.crypto

string

 

A reference to a org.apache.wss4j.common.crypto.Crypto to be used for encryption. If not set, encryption.properties will be used to configure a Crypto instance.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENCRYPTION_CRYPTO
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.encryption.certificate

string

 

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 encryption.properties or extracted from request (when WS-Security is used and if encryption.username has value useReqSigCert.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENCRYPTION_CERTIFICATE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.enable-revocation

boolean

false

If true, Certificate Revocation List (CRL) checking is enabled when verifying trust in a certificate; otherwise it is not enabled.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENABLE_REVOCATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.enable-unsigned-saml-assertion-principal

boolean

false

If true, unsigned SAML assertions will be allowed as SecurityContext Principals; otherwise they won’t be allowed as SecurityContext Principals.

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: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENABLE_UNSIGNED_SAML_ASSERTION_PRINCIPAL
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.validate-saml-subject-confirmation

boolean

true

If true, the SubjectConfirmation requirements of a received SAML Token (sender-vouches or holder-of-key) will be validated; otherwise they won’t be validated.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_VALIDATE_SAML_SUBJECT_CONFIRMATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.sc-from-jaas-subject

boolean

true

If true, security context can be created from JAAS Subject; otherwise it must not be created from JAAS Subject.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SC_FROM_JAAS_SUBJECT
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.audience-restriction-validation

boolean

true

If true, then if the SAML Token contains Audience Restriction URIs, one of them must match one of the values in audience.restrictions; otherwise the SAML AudienceRestriction validation is disabled.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_AUDIENCE_RESTRICTION_VALIDATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.saml-role-attributename

string

http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role

The attribute URI of the SAML AttributeStatement where the role information is stored.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SAML_ROLE_ATTRIBUTENAME
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.subject-cert-constraints

string

 

A String of regular expressions (separated by the value specified in security.cert.constraints.separator) which will be applied to the subject DN of the certificate used for signature validation, after trust verification of the certificate chain associated with the certificate.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SUBJECT_CERT_CONSTRAINTS
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.cert-constraints-separator

string

,

The separator that is used to parse certificate constraints configured in security.subject.cert.constraints

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CERT_CONSTRAINTS_SEPARATOR
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.actor

string

 

The actor or role name of the wsse:Security header. If this parameter is omitted, the actor name is not set.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ACTOR
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.validate.token

boolean

true

If true, the password of a received UsernameToken will be validated; otherwise it won’t be validated.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_VALIDATE_TOKEN
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.username-token.always.encrypted

boolean

true

Whether to always encrypt UsernameTokens that are defined as a SupportingToken. This should not be set to false in a production environment, as it exposes the password (or the digest of the password) on the wire.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_USERNAME_TOKEN_ALWAYS_ENCRYPTED
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.is-bsp-compliant

boolean

true

If true, the compliance with the Basic Security Profile (BSP) 1.1 will be ensured; otherwise it will not be ensured.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_IS_BSP_COMPLIANT
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.enable.nonce.cache

boolean

 

If true, the UsernameToken nonces will be cached for both message initiators and recipients; otherwise they won’t be cached for neither message initiators nor recipients. The default is true for message recipients, and false for message initiators.

Caching

Caching only applies when either a UsernameToken WS-SecurityPolicy is in effect, or the UsernameToken action has been configured for the non-security-policy case.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENABLE_NONCE_CACHE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.enable.timestamp.cache

boolean

 

If true, the Timestamp Created Strings (these are only cached in conjunction with a message Signature) will be cached for both message initiators and recipients; otherwise they won’t be cached for neither message initiators nor recipients. The default is true for message recipients, and false for message initiators.

Caching

Caching only applies when either a IncludeTimestamp policy is in effect, or the Timestamp action has been configured for the non-security-policy case.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENABLE_TIMESTAMP_CACHE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.enable.streaming

boolean

false

If true, the new streaming (StAX) implementation of WS-Security is used; otherwise the old DOM implementation is used.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENABLE_STREAMING
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.return.security.error

boolean

false

If true, detailed security error messages are sent to clients; otherwise the details are omitted and only a generic error message is sent.

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: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_RETURN_SECURITY_ERROR
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.must-understand

boolean

true

If true, the SOAP mustUnderstand header is included in security headers based on a WS-SecurityPolicy; otherwise the header is always omitted.

Works only with enable.streaming = true - see CXF-8940

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_MUST_UNDERSTAND
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.enable.saml.cache

boolean

 

If true and in case the token contains a OneTimeUse Condition, the SAML2 Token Identifiers will be cached for both message initiators and recipients; otherwise they won’t be cached for neither message initiators nor recipients. The default is true for message recipients, and false for message initiators.

Caching only applies when either a SamlToken policy is in effect, or a SAML action has been configured for the non-security-policy case.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ENABLE_SAML_CACHE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.store.bytes.in.attachment

boolean

 

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: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_STORE_BYTES_IN_ATTACHMENT
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.swa.encryption.attachment.transform.content

boolean

false

If true, Attachment-Content-Only transform will be used when an Attachment is encrypted via a WS-SecurityPolicy expression; otherwise Attachment-Complete transform will be used when an Attachment is encrypted via a WS-SecurityPolicy expression.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SWA_ENCRYPTION_ATTACHMENT_TRANSFORM_CONTENT
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.use.str.transform

boolean

true

If true, the STR (Security Token Reference) Transform will be used when (externally) signing a SAML Token; otherwise the STR (Security Token Reference) Transform will not be used.

Some frameworks cannot process the SecurityTokenReference. You may set this false in such cases.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_USE_STR_TRANSFORM
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.add.inclusive.prefixes

boolean

true

If true, an InclusiveNamespaces PrefixList will be added as a CanonicalizationMethod child when generating Signatures using WSConstants.C14N_EXCL_OMIT_COMMENTS; otherwise the PrefixList will not be added.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ADD_INCLUSIVE_PREFIXES
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.disable.require.client.cert.check

boolean

false

If true, the enforcement of the WS-SecurityPolicy RequireClientCertificate policy will be disabled; otherwise the enforcement of the WS-SecurityPolicy RequireClientCertificate policy is enabled.

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: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_DISABLE_REQUIRE_CLIENT_CERT_CHECK
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.expand.xop.include

boolean

 

If true, the xop:Include elements will be searched for encryption and signature (on the outbound side) or for signature verification (on the inbound side); otherwise the search won’t happen. This ensures that the actual bytes are signed, and not just the reference. The default is true if MTOM is enabled, otherwise the default is false.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_EXPAND_XOP_INCLUDE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.timestamp.timeToLive

string

300

The time in seconds to add to the Creation value of an incoming Timestamp to determine whether to accept it as valid or not.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_TIMESTAMP_TIMETOLIVE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.timestamp.futureTimeToLive

string

60

The time in seconds in the future within which the Created time of an incoming Timestamp is valid. The default is greater than zero to avoid problems where clocks are slightly askew. Set this to 0 to reject all future-created `Timestamp`s.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_TIMESTAMP_FUTURETIMETOLIVE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.usernametoken.timeToLive

string

300

The time in seconds to append to the Creation value of an incoming UsernameToken to determine whether to accept it as valid or not.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_USERNAMETOKEN_TIMETOLIVE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.usernametoken.futureTimeToLive

string

60

The time in seconds in the future within which the Created time of an incoming UsernameToken is valid. The default is greater than zero to avoid problems where clocks are slightly askew. Set this to 0 to reject all future-created `UsernameToken`s.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_USERNAMETOKEN_FUTURETIMETOLIVE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.spnego.client.action

string

 

A reference to a org.apache.wss4j.common.spnego.SpnegoClientAction bean to use for SPNEGO. This allows the user to plug in a different implementation to obtain a service ticket.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SPNEGO_CLIENT_ACTION
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.nonce.cache.instance

string

 

A reference to a org.apache.wss4j.common.cache.ReplayCache bean used to cache UsernameToken nonces. A org.apache.wss4j.common.cache.EHCacheReplayCache instance is used by default.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_NONCE_CACHE_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.timestamp.cache.instance

string

 

A reference to a org.apache.wss4j.common.cache.ReplayCache bean used to cache Timestamp Created Strings. A org.apache.wss4j.common.cache.EHCacheReplayCache instance is used by default.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_TIMESTAMP_CACHE_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.saml.cache.instance

string

 

A reference to a org.apache.wss4j.common.cache.ReplayCache bean used to cache SAML2 Token Identifier Strings (if the token contains a OneTimeUse condition). A org.apache.wss4j.common.cache.EHCacheReplayCache instance is used by default.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SAML_CACHE_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.cache.config.file

string

 

Set this property to point to a configuration file for the underlying caching implementation for the TokenStore. The default configuration file that is used is cxf-ehcache.xml in org.apache.cxf:cxf-rt-security JAR.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CACHE_CONFIG_FILE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.token-store-cache-instance

string

 

A reference to a org.apache.cxf.ws.security.tokenstore.TokenStore bean to use for caching security tokens. By default this uses a instance.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_TOKEN_STORE_CACHE_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.cache.identifier

string

 

The Cache Identifier to use with the TokenStore. CXF uses the following key to retrieve a token store: org.apache.cxf.ws.security.tokenstore.TokenStore-<identifier>. This key can be used to configure service-specific cache configuration. If the identifier does not match, then it falls back to a cache configuration with key org.apache.cxf.ws.security.tokenstore.TokenStore.

The default <identifier> is the QName of the service in question. However to pick up a custom cache configuration (for example, if you want to specify a TokenStore per-client proxy), it can be configured with this identifier instead.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CACHE_IDENTIFIER
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.role.classifier

string

 

The Subject Role Classifier to use. If one of the WSS4J Validators returns a JAAS Subject from Validation, then the WSS4JInInterceptor will attempt to create a SecurityContext based on this Subject. If this value is not specified, then it tries to get roles using the DefaultSecurityContext in org.apache.cxf:cxf-core. Otherwise it uses this value in combination with the role.classifier.type to get the roles from the Subject.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ROLE_CLASSIFIER
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.role.classifier.type

string

prefix

The Subject Role Classifier Type to use. If one of the WSS4J Validators returns a JAAS Subject from Validation, then the WSS4JInInterceptor will attempt to create a SecurityContext based on this Subject. Currently accepted values are prefix or classname. Must be used in conjunction with the role.classifier.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ROLE_CLASSIFIER_TYPE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.asymmetric.signature.algorithm

string

 

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: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_ASYMMETRIC_SIGNATURE_ALGORITHM
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.symmetric.signature.algorithm

string

 

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: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SYMMETRIC_SIGNATURE_ALGORITHM
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.password.encryptor.instance

string

 

A reference to a org.apache.wss4j.common.crypto.PasswordEncryptor bean, which is used to encrypt or decrypt passwords in the Merlin Crypto implementation (or any custom Crypto implementations).

By default, WSS4J uses the org.apache.wss4j.common.crypto.JasyptPasswordEncryptor which must be instantiated with a password to use to decrypt keystore passwords in the Merlin Crypto definition. This password is obtained via the CallbackHandler defined via callback-handler

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: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_PASSWORD_ENCRYPTOR_INSTANCE
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.delegated.credential

string

 

A reference to a Kerberos org.ietf.jgss.GSSCredential bean to use for WS-Security. This is used to retrieve a service ticket instead of using the client credentials.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_DELEGATED_CREDENTIAL
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.security.context.creator

string

 

A reference to a org.apache.cxf.ws.security.wss4j.WSS4JSecurityContextCreator bean that is used to create a CXF SecurityContext from the set of WSS4J processing results. The default implementation is org.apache.cxf.ws.security.wss4j.DefaultWSS4JSecurityContextCreator.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SECURITY_CONTEXT_CREATOR
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.security.token.lifetime

long

300000

The security token lifetime value (in milliseconds).

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_SECURITY_TOKEN_LIFETIME
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.kerberos.request.credential.delegation

boolean

false

If true, credential delegation is requested in the KerberosClient; otherwise the credential delegation is not in the KerberosClient.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_KERBEROS_REQUEST_CREDENTIAL_DELEGATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.kerberos.use.credential.delegation

boolean

false

If true, GSSCredential bean is retrieved from the Message Context using the delegated.credential property and then it is used to obtain a service ticket.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_KERBEROS_USE_CREDENTIAL_DELEGATION
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.kerberos.is.username.in.servicename.form

boolean

false

If true, the Kerberos username is in servicename form; otherwise the Kerberos username is not in servicename form.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_KERBEROS_IS_USERNAME_IN_SERVICENAME_FORM
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.kerberos.jaas.context

string

 

The JAAS Context name to use for Kerberos.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_KERBEROS_JAAS_CONTEXT
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.kerberos.spn

string

 

The Kerberos Service Provider Name (spn) to use.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_KERBEROS_SPN
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.kerberos.client

string

 

A reference to a org.apache.cxf.ws.security.kerberos.KerberosClient bean used to obtain a service ticket.

This option is experimental, because it is not covered by tests yet.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_KERBEROS_CLIENT
Since Quarkus CXF: 2.5.0

quarkus.cxf.endpoint."/endpoint-path".security.custom.digest.algorithm

string

http://www.w3.org/2001/04/xmlenc#sha256

The Digest Algorithm to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite, for instance

<wsp:Policy wsu:Id="SecurityServiceEncryptThenSignPolicy"
  xmlns:wsp="http://www.w3.org/ns/ws-policy"
  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
  <wsp:ExactlyOne>
    <wsp:All>
      <sp:AsymmetricBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
        <wsp:Policy>
          ...
          <sp:AlgorithmSuite>
            <wsp:Policy>
              <sp:CustomAlgorithmSuite/>
            </wsp:Policy>
          </sp:AlgorithmSuite>
          ...
        </wsp:Policy>
      </sp:AsymmetricBinding>
      ...
    </wsp:All>
  </wsp:ExactlyOne>
</wsp:Policy>
Copy to Clipboard Toggle word wrap

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_DIGEST_ALGORITHM
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.encryption.algorithm

string

http://www.w3.org/2009/xmlenc11#aes256-gcm

The Encryption Algorithm to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_ENCRYPTION_ALGORITHM
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.symmetric.key.encryption.algorithm

string

http://www.w3.org/2001/04/xmlenc#kw-aes256

The Symmetric Key Encryption Algorithm to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_SYMMETRIC_KEY_ENCRYPTION_ALGORITHM
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.asymmetric.key.encryption.algorithm

string

http://www.w3.org/2001/04/xmlenc#rsa-1_5

The Asymmetric Key Encryption Algorithm to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_ASYMMETRIC_KEY_ENCRYPTION_ALGORITHM
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.encryption.key.derivation

string

http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1

The Encryption Key Derivation to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_ENCRYPTION_KEY_DERIVATION
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.signature.key.derivation

string

http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1

The Signature Key Derivation to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_SIGNATURE_KEY_DERIVATION
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.encryption.derived.key.length

int

256

The Encryption Derived Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_ENCRYPTION_DERIVED_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.signature.derived.key.length

int

192

The Signature Derived Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_SIGNATURE_DERIVED_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.minimum.symmetric.key.length

int

256

The Minimum Symmetric Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_MINIMUM_SYMMETRIC_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.maximum.symmetric.key.length

int

256

The Maximum Symmetric Key Length to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_MAXIMUM_SYMMETRIC_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.minimum.asymmetric.key.length

int

1024

The Minimum Symmetric Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_MINIMUM_ASYMMETRIC_KEY_LENGTH
Since Quarkus CXF: 3.8.1

quarkus.cxf.endpoint."/endpoint-path".security.custom.maximum.asymmetric.key.length

int

4096

The Maximum Symmetric Key Length (number of bits) to set on the org.apache.wss4j.policy.model.AlgorithmSuite.AlgorithmSuiteType. This value is only taken into account if the current security policy has set CustomAlgorithmSuite as an AlgorithmSuite

For more information about algorithms, see WS-SecurityPolicy 1.2 specification and the Algorithms section of XML Encryption Syntax and Processing Specification.

CustomAlgorithmSuite and the *.security.custom.* family of options were introduced to make it possible to run CXF SOAP clients and services on systems with FIPS assertions enabled.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__SECURITY_CUSTOM_MAXIMUM_ASYMMETRIC_KEY_LENGTH
Since Quarkus CXF: 3.8.1

4.5. WS-ReliableMessaging

WS-ReliableMessaging (WS-RM) is a protocol ensuring a reliable delivery of messages in a distributed environment even in presence of software, system, or network failures.

This extension provides CXF framework’s WS-ReliableMessaging implementation.

4.5.1. Maven coordinates

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>
Copy to Clipboard Toggle word wrap

4.5.2. Supported standards

4.5.3. Usage

Once your application depends on quarkus-cxf-rt-ws-rm, WS-RM is enabled for all clients and service endpoints defined in application.properties. This is due to the fact that the quarkus.cxf.client."client-name".rm.enabled and quarkus.cxf.endpoint."/endpoint-path".rm.enabled properties are true by default.

Enabling WS-RM for a client or service endpoints means that WS-RM interceptors will be added to the given client or endpoint.

In addition to that you may want to set some of the options documented below and/or the following WS-Addressing options:

4.5.3.1. Runnable example

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
Copy to Clipboard Toggle word wrap

And then you can run the test scenario implemented in the client module:

$ cd ../../integration-tests/ws-rm-client
$ mvn clean test
Copy to Clipboard Toggle word wrap

You should see the exchange of SOAP messages between the client, the server and the decoupled endpoint in the console.

4.5.4. Configuration

lock Configuration property fixed at build time. All other configuration properties are overridable at runtime.

Expand
Configuration propertyTypeDefault

quarkus.cxf.rm.namespace

string

http://schemas.xmlsoap.org/ws/2005/02/rm

WS-RM version namespace: http://schemas.xmlsoap.org/ws/2005/02/rm/ or http://docs.oasis-open.org/ws-rx/wsrm/200702

Environment variable: QUARKUS_CXF_RM_NAMESPACE
Since Quarkus CXF: 2.7.0

quarkus.cxf.rm.wsa-namespace

string

http://schemas.xmlsoap.org/ws/2004/08/addressing

WS-Addressing version namespace: http://schemas.xmlsoap.org/ws/2004/08/addressing or http://www.w3.org/2005/08/addressing. Note that this property is ignored unless you are using the http://schemas.xmlsoap.org/ws/2005/02/rm/ RM namespace.

Environment variable: QUARKUS_CXF_RM_WSA_NAMESPACE
Since Quarkus CXF: 2.7.0

quarkus.cxf.rm.inactivity-timeout

long

 

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: QUARKUS_CXF_RM_INACTIVITY_TIMEOUT
Since Quarkus CXF: 2.7.0

quarkus.cxf.rm.retransmission-interval

long

3000

A time duration in milliseconds between successive attempts to resend a message that has not been acknowledged by the receiver.

Environment variable: QUARKUS_CXF_RM_RETRANSMISSION_INTERVAL
Since Quarkus CXF: 2.7.0

quarkus.cxf.rm.exponential-backoff

boolean

false

If true the retransmission interval will be doubled on every transmission attempt; otherwise the retransmission interval stays equal to quarkus.cxf.rm.retransmission-interval for every retransmission attempt.

Environment variable: QUARKUS_CXF_RM_EXPONENTIAL_BACKOFF
Since Quarkus CXF: 2.7.0

quarkus.cxf.rm.acknowledgement-interval

long

 

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: QUARKUS_CXF_RM_ACKNOWLEDGEMENT_INTERVAL
Since Quarkus CXF: 2.7.0

quarkus.cxf.rm.store

string

 

A reference to a org.apache.cxf.ws.rm.persistence.RMStore bean used to store source and destination sequences and message references.

Environment variable: QUARKUS_CXF_RM_STORE
Since Quarkus CXF: 2.7.0

quarkus.cxf.rm.feature-ref

string

#defaultRmFeature

A reference to a org.apache.cxf.ws.rm.feature.RMFeature bean to set on clients and service endpoint which have quarkus.cxf.[client|service]."name".rm.enabled = true.

If the value is #defaultRmFeature then Quarkus CXF creates and configures the bean for you.

Environment variable: QUARKUS_CXF_RM_FEATURE_REF
Since Quarkus CXF: 2.7.0

quarkus.cxf.client."client-name".rm.enabled

boolean

true

If true then the WS-ReliableMessaging interceptors will be added to this client or service endpoint.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__RM_ENABLED
Since Quarkus CXF: 2.7.0

quarkus.cxf.endpoint."/endpoint-path".rm.enabled

boolean

true

If true then the WS-ReliableMessaging interceptors will be added to this client or service endpoint.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__RM_ENABLED
Since Quarkus CXF: 2.7.0

4.6. Security Token Service (STS)

Issue, renew and validate security tokens in context of WS-Trust.

4.6.1. Maven coordinates

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>
Copy to Clipboard Toggle word wrap

4.6.2. Supported standards

4.6.3. Usage

Here are the key parts of a basic WS-Trust scenario:

  • WS-SecurityPolicy - except for defining security requirements, such as transport protocols, encryption and signing, it can also contain an <IssuedToken> assertion. It specifies the requirements and constraints for these security tokens that the client must adhere to when accessing the service.
  • Security Token Service (STS) - issues, validates, and renews security tokens upon request. It acts as a trusted authority that authenticates clients and issues tokens that assert the client’s identity and permissions.
  • Client - requests a token from the STS to access a web service. It must authenticate itself to the STS and provide details about the kind of token required.
  • Service - relies on the STS to authenticate clients and validate their tokens.
4.6.3.1. Runnable example

There is an integration test covering WS-Trust in the Quarkus CXF source tree. Let’s walk through it and see how the individual parts are set to work together.

4.6.3.1.1. WS-SecurityPolicy

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

                            <sp:IssuedToken
                                sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
                                <sp:RequestSecurityTokenTemplate>
                                    <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
                                    <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey</t:KeyType>
                                </sp:RequestSecurityTokenTemplate>
                                <wsp:Policy>
                                    <sp:RequireInternalReference />
                                </wsp:Policy>
                                <sp:Issuer>
                                    <wsaws:Address>http://localhost:8081/services/sts</wsaws:Address>
                                    <wsaws:Metadata xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
                                                    wsdli:wsdlLocation="http://localhost:8081/services/sts?wsdl">
                                        <wsaw:ServiceName xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
                                                        xmlns:stsns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
                                                        EndpointName="UT_Port">stsns:SecurityTokenService</wsaw:ServiceName>
                                    </wsaws:Metadata>
                                </sp:Issuer>
                            </sp:IssuedToken>
Copy to Clipboard Toggle word wrap

4.6.3.1.2. Security Token Service (STS)

The STS is implemented in Sts.java:

Sts.java

@WebServiceProvider(serviceName = "SecurityTokenService", portName = "UT_Port", targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/", wsdlLocation = "ws-trust-1.4-service.wsdl")
public class Sts extends SecurityTokenServiceProvider {

    public Sts() throws Exception {
        super();

        StaticSTSProperties props = new StaticSTSProperties();
        props.setSignatureCryptoProperties("stsKeystore.properties");
        props.setSignatureUsername("sts");
        props.setCallbackHandlerClass(StsCallbackHandler.class.getName());
        props.setIssuer("SampleSTSIssuer");

        List<ServiceMBean> services = new LinkedList<ServiceMBean>();
        StaticService service = new StaticService();
        final Config config = ConfigProvider.getConfig();
        final int port = LaunchMode.current().equals(LaunchMode.TEST) ? config.getValue("quarkus.http.test-port", Integer.class)
                : config.getValue("quarkus.http.port", Integer.class);
        service.setEndpoints(Arrays.asList(
                "http://localhost:" + port + "/services/hello-ws-trust",
                "http://localhost:" + port + "/services/hello-ws-trust-actas",
                "http://localhost:" + port + "/services/hello-ws-trust-onbehalfof"));
        services.add(service);

        TokenIssueOperation issueOperation = new TokenIssueOperation();
        issueOperation.setServices(services);
        issueOperation.getTokenProviders().add(new SAMLTokenProvider());
        // required for OnBehalfOf
        issueOperation.getTokenValidators().add(new UsernameTokenValidator());
        // added for OnBehalfOf and ActAs
        issueOperation.getDelegationHandlers().add(new UsernameTokenDelegationHandler());
        issueOperation.setStsProperties(props);

        TokenValidateOperation validateOperation = new TokenValidateOperation();
        validateOperation.getTokenValidators().add(new SAMLTokenValidator());
        validateOperation.setStsProperties(props);

        this.setIssueOperation(issueOperation);
        this.setValidateOperation(validateOperation);
    }
}
//end::ws-trust-usage.adoc-sts[]
Copy to Clipboard Toggle word wrap

and configured in application.properties:

application.properties

quarkus.cxf.endpoint."/sts".implementor = io.quarkiverse.cxf.it.ws.trust.sts.Sts
quarkus.cxf.endpoint."/sts".logging.enabled = pretty

quarkus.cxf.endpoint."/sts".security.signature.username = sts
quarkus.cxf.endpoint."/sts".security.signature.password = password
quarkus.cxf.endpoint."/sts".security.validate.token = false

quarkus.cxf.endpoint."/sts".security.signature.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin
quarkus.cxf.endpoint."/sts".security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.type" = pkcs12
quarkus.cxf.endpoint."/sts".security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password
quarkus.cxf.endpoint."/sts".security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.file" = sts.pkcs12
Copy to Clipboard Toggle word wrap

4.6.3.1.3. Service

The service is implemented in TrustHelloServiceImpl.java:

TrustHelloServiceImpl.java

@WebService(portName = "TrustHelloServicePort", serviceName = "TrustHelloService", targetNamespace = "https://quarkiverse.github.io/quarkiverse-docs/quarkus-cxf/test/ws-trust", endpointInterface = "io.quarkiverse.cxf.it.ws.trust.server.TrustHelloService")
public class TrustHelloServiceImpl implements TrustHelloService {
    @WebMethod
    @Override
    public String hello(String person) {
        return "Hello " + person + "!";
    }
}
//end::ws-trust-usage.adoc-service[]
Copy to Clipboard Toggle word wrap

The asymmetric-saml2-policy.xml mentioned above is set in the Service Endpoint Interface TrustHelloService.java:

TrustHelloServiceImpl.java

@WebService(targetNamespace = "https://quarkiverse.github.io/quarkiverse-docs/quarkus-cxf/test/ws-trust")
@Policy(placement = Policy.Placement.BINDING, uri = "classpath:/asymmetric-saml2-policy.xml")
public interface TrustHelloService {
    @WebMethod
    @Policies({
            @Policy(placement = Policy.Placement.BINDING_OPERATION_INPUT, uri = "classpath:/io-policy.xml"),
            @Policy(placement = Policy.Placement.BINDING_OPERATION_OUTPUT, uri = "classpath:/io-policy.xml")
    })
    String hello(String person);
}
Copy to Clipboard Toggle word wrap

The service endpoint is configured in application.properties:

application.properties

quarkus.cxf.endpoint."/hello-ws-trust".implementor = io.quarkiverse.cxf.it.ws.trust.server.TrustHelloServiceImpl
quarkus.cxf.endpoint."/hello-ws-trust".logging.enabled = pretty

quarkus.cxf.endpoint."/hello-ws-trust".security.signature.username = service
quarkus.cxf.endpoint."/hello-ws-trust".security.signature.password = password
quarkus.cxf.endpoint."/hello-ws-trust".security.signature.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin
quarkus.cxf.endpoint."/hello-ws-trust".security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.type" = pkcs12
quarkus.cxf.endpoint."/hello-ws-trust".security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password
quarkus.cxf.endpoint."/hello-ws-trust".security.signature.properties."org.apache.ws.security.crypto.merlin.keystore.alias" = service
quarkus.cxf.endpoint."/hello-ws-trust".security.signature.properties."org.apache.ws.security.crypto.merlin.file" = service.pkcs12

quarkus.cxf.endpoint."/hello-ws-trust".security.encryption.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin
quarkus.cxf.endpoint."/hello-ws-trust".security.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.type" = pkcs12
quarkus.cxf.endpoint."/hello-ws-trust".security.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password
quarkus.cxf.endpoint."/hello-ws-trust".security.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.alias" = service
quarkus.cxf.endpoint."/hello-ws-trust".security.encryption.properties."org.apache.ws.security.crypto.merlin.file" = service.pkcs12
Copy to Clipboard Toggle word wrap

4.6.3.1.4. Client

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

quarkus.cxf.client.hello-ws-trust.security.sts.client.wsdl = http://localhost:${quarkus.http.test-port}/services/sts?wsdl
quarkus.cxf.client.hello-ws-trust.security.sts.client.service-name = {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService
quarkus.cxf.client.hello-ws-trust.security.sts.client.endpoint-name = {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}UT_Port
quarkus.cxf.client.hello-ws-trust.security.sts.client.username = client
quarkus.cxf.client.hello-ws-trust.security.sts.client.password = password
quarkus.cxf.client.hello-ws-trust.security.sts.client.encryption.username = sts
quarkus.cxf.client.hello-ws-trust.security.sts.client.encryption.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin
quarkus.cxf.client.hello-ws-trust.security.sts.client.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.type" = pkcs12
quarkus.cxf.client.hello-ws-trust.security.sts.client.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password
quarkus.cxf.client.hello-ws-trust.security.sts.client.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.alias" = client
quarkus.cxf.client.hello-ws-trust.security.sts.client.encryption.properties."org.apache.ws.security.crypto.merlin.keystore.file" = client.pkcs12
quarkus.cxf.client.hello-ws-trust.security.sts.client.token.username = client
quarkus.cxf.client.hello-ws-trust.security.sts.client.token.properties."org.apache.ws.security.crypto.provider" = org.apache.ws.security.components.crypto.Merlin
quarkus.cxf.client.hello-ws-trust.security.sts.client.token.properties."org.apache.ws.security.crypto.merlin.keystore.type" = pkcs12
quarkus.cxf.client.hello-ws-trust.security.sts.client.token.properties."org.apache.ws.security.crypto.merlin.keystore.password" = password
quarkus.cxf.client.hello-ws-trust.security.sts.client.token.properties."org.apache.ws.security.crypto.merlin.keystore.alias" = client
quarkus.cxf.client.hello-ws-trust.security.sts.client.token.properties."org.apache.ws.security.crypto.merlin.keystore.file" = client.pkcs12
quarkus.cxf.client.hello-ws-trust.security.sts.client.token.usecert = true
Copy to Clipboard Toggle word wrap

Tip

The properties for configuring the STS client are provided by the io.quarkiverse.cxf:quarkus-cxf-rt-ws-security extension and documented on its reference page.

Alternatively, the client can be set as a bean reference:

application.properties

quarkus.cxf.client.hello-ws-trust-bean.security.sts.client = #stsClientBean
Copy to Clipboard Toggle word wrap

In that case, the @Named bean needs to be produced programmatically, e.g. using @jakarta.enterprise.inject.Produces:

BeanProducers.java

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Named;

import org.apache.cxf.ws.security.SecurityConstants;

import io.quarkiverse.cxf.ws.security.sts.client.STSClientBean;

public class BeanProducers {

    /**
     * Create and configure an STSClient for use by the TrustHelloService client.
     */
    @Produces
    @ApplicationScoped
    @Named("stsClientBean")
    STSClientBean createSTSClient() {
        /*
         * We cannot use org.apache.cxf.ws.security.trust.STSClient as a return type of this bean producer method
         * because it does not have a no-args constructor. STSClientBean is a subclass of STSClient having one.
         */
        STSClientBean stsClient = STSClientBean.create();
        stsClient.setWsdlLocation("http://localhost:8081/services/sts?wsdl");
        stsClient.setServiceQName(new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService"));
        stsClient.setEndpointQName(new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port"));
        Map<String, Object> props = stsClient.getProperties();
        props.put(SecurityConstants.USERNAME, "client");
        props.put(SecurityConstants.PASSWORD, "password");
        props.put(SecurityConstants.ENCRYPT_PROPERTIES,
                Thread.currentThread().getContextClassLoader().getResource("clientKeystore.properties"));
        props.put(SecurityConstants.ENCRYPT_USERNAME, "sts");
        props.put(SecurityConstants.STS_TOKEN_USERNAME, "client");
        props.put(SecurityConstants.STS_TOKEN_PROPERTIES,
                Thread.currentThread().getContextClassLoader().getResource("clientKeystore.properties"));
        props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
        return stsClient;
    }
}
Copy to Clipboard Toggle word wrap

4.7. HTTP Async Transport

Implement async SOAP Clients using Apache HttpComponents HttpClient 5.

4.7.1. Maven coordinates

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>
Copy to Clipboard Toggle word wrap

4.7.2. Usage

Once the quarkus-cxf-rt-transports-http-hc5 dependency is available in the classpath, CXF will use HttpAsyncClient for asynchronous calls and will continue using HttpURLConnection for synchronous calls.

4.7.2.1. Generate async methods

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:

Tip

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

<?xml version="1.0"?>
<bindings
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns="https://jakarta.ee/xml/ns/jaxws"
        wsdlLocation="CalculatorService.wsdl">
    <bindings node="wsdl:definitions">
        <enableAsyncMapping>true</enableAsyncMapping>
    </bindings>
</bindings>
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

4.7.2.2. Asynchronous Clients and Mutiny

Once the asynchronous stubs are available, it is possible to wrap a client call in io.smallrye.mutiny.Uni as shown below:

package io.quarkiverse.cxf.hc5.it;

import java.util.concurrent.Future;

import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.jboss.eap.quickstarts.wscalculator.calculator.AddResponse;
import org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService;

import io.quarkiverse.cxf.annotation.CXFClient;
import io.smallrye.mutiny.Uni;

@Path("/hc5")
public class Hc5Resource {

    @Inject
    @CXFClient("myCalculator") // name used in application.properties
    CalculatorService myCalculator;

    @SuppressWarnings("unchecked")
    @Path("/add-async")
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public Uni<Integer> addAsync(@QueryParam("a") int a, @QueryParam("b") int b) {
        return Uni.createFrom()
                .future(
                        (Future<AddResponse>) myCalculator
                                .addAsync(a, b, res -> {
                                }))
                .map(addResponse -> addResponse.getReturn());
    }

}
Copy to Clipboard Toggle word wrap
4.7.2.3. Thread pool

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.

Tip

You can see more details about the CXF asynchronous client and how to tune it further in CXF documentation.

4.8. XJC Plugins

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 - generate getFoo() instead of isFoo() 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 on xs:documentation present in the schema.
  • -xjc-Xproperty-listener - add PropertyChangeListener support to the generated beans.
  • -xjc-Xts - generate toString() methods in model classes.
  • -xjc-Xwsdlextension - generate beans that can be used directly with WSDL4J as extensors in the WSDL.
Tip

Check the wsdl2java section of User guide for more details about wsdl2java.

4.8.1. Maven coordinates

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>
Copy to Clipboard Toggle word wrap

Chapter 5. Quarkus CXF user guide

This chapter provides information about Quarkus CXF usage and configuration.

5.1. User guide

This User guide explains typical use cases of Quarkus CXF.

You may want to start with some of the following topics:

5.1.1. Create a new project

This guide explains how to set up a new project for a Quarkus application hosting a CXF client or server or both.

5.1.1.1. Prerequisites

Read the Prerequisites section of Quarkus getting started guide.

In addition to that, you may need

  • GraalVM with the native-image command installed and the GRAALVM_HOME environment variable set. See Building a native executable section of the Quarkus documentation.
  • If you are on Linux, a container runtime like docker is sufficient for the native mode too. Use -Pnative -Dquarkus.native.container-build=true instead of -Pnative if you choose this option.
5.1.1.2. Creating a project

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-cxf extension is enough.
  • Click the blue Generate your application button to download a basic skeleton project.
  • Unpack the zip file and import the project the into your favorite IDE.
5.1.1.3. Quarkus Platform

Quarkus CXF is a part of Quarkus Platform since Quarkus Platform version 3.1.0.Final.

Quarkus Platform aggregates Quarkus extensions produced by various independent projects, such as Quarkus Core, Quarkus CXF, Apache Camel, Qpid JMS, Debezium and others.

Its main goals are:

5.1.1.4. Dependency management

We recommend using Quarkus Platform BOMs to manage Quarkus CXF dependencies. That’s exactly what you get, when you use code.quarkus.redhat.com or other Quarkus development tools, such as Quarkus CLI.

<project ...>
  ...
  <properties>
    ...
    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
    <quarkus.platform.version><!-- Check the latest https://repo1.maven.org/maven2/io/quarkus/platform/quarkus-cxf-bom/ --></quarkus.platform.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>${quarkus.platform.artifact-id}</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>quarkus-cxf-bom</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
...
Copy to Clipboard Toggle word wrap

You should always take care to import the same version of io.quarkus.platform:quarkus-bom and io.quarkus.platform:quarkus-cxf-bom into your project. That’s the most reliable way to get compatible versions of Quarkus, CXF, Quarkus CXF and all their transitive dependencies.

5.1.1.5. Where to go next

We recommend to proceed with any of the following chapters:

5.1.2. Your first SOAP Web service on Quarkus

In this guide we explain how to create a Quarkus application exposing a simple SOAP Web service.

Create project first

Follow the Project creation guide before proceeding here.

5.1.2.1. Hello world! Web service

Having the pom.xml in place, you can add a simple Hello world! Web service in src/main/java.

Code examples

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

package io.quarkiverse.cxf.it.server;

import jakarta.jws.WebMethod;
import jakarta.jws.WebService;

/**
 * The simplest Hello service.
 */
@WebService(name = "HelloService", serviceName = "HelloService")
public interface HelloService {

    @WebMethod
    String hello(String text);

}
Copy to Clipboard Toggle word wrap

and then the implementation:

HelloServiceImpl.java

package io.quarkiverse.cxf.it.server;

import jakarta.jws.WebMethod;
import jakarta.jws.WebService;

/**
 * The simplest Hello service implementation.
 */
@WebService(serviceName = "HelloService")
public class HelloServiceImpl implements HelloService {

    @WebMethod
    @Override
    public String hello(String text) {
        return "Hello " + text + "!";
    }

}
Copy to Clipboard Toggle word wrap

For the implementation to get exposed under a certain path, you need to add the following configuration to application.properties:

# The context path under which all services will be available
quarkus.cxf.path = /soap

# Publish "HelloService" under the context path /${quarkus.cxf.path}/hello
quarkus.cxf.endpoint."/hello".implementor = io.quarkiverse.cxf.it.server.HelloServiceImpl
quarkus.cxf.endpoint."/hello".features = org.apache.cxf.ext.logging.LoggingFeature
Copy to Clipboard Toggle word wrap
Tip

All configuration properties are documented in the Configuration properties reference.

Tip

Check the Service endpoints and paths chapter to learn about alternative ways to expose a service endpoint under a specific path.

With these files in place, you can start Quarkus in dev mode:

$ mvn quarkus:dev
Copy to Clipboard Toggle word wrap

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:

$ curl http://localhost:8080/soap/hello?wsdl
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://server.it.cxf.quarkiverse.io/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
    name="HelloService" targetNamespace="http://server.it.cxf.quarkiverse.io/">
  <wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://server.it.cxf.quarkiverse.io/" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://server.it.cxf.quarkiverse.io/">
  <xsd:element name="hello" type="tns:hello"/>
  <xsd:complexType name="hello">
    <xsd:sequence>
      <xsd:element minOccurs="0" name="arg0" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:element name="helloResponse" type="tns:helloResponse"/>
  <xsd:complexType name="helloResponse">
    <xsd:sequence>
      <xsd:element minOccurs="0" name="return" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>
  </wsdl:types>
  <wsdl:message name="helloResponse">
    <wsdl:part element="tns:helloResponse" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="hello">
    <wsdl:part element="tns:hello" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="HelloService">
    <wsdl:operation name="hello">
      <wsdl:input message="tns:hello" name="hello">
    </wsdl:input>
      <wsdl:output message="tns:helloResponse" name="helloResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="HelloServiceSoapBinding" type="tns:HelloService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="hello">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="hello">
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="helloResponse">
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="HelloService">
    <wsdl:port binding="tns:HelloServiceSoapBinding" name="HelloServicePort">
      <soap:address location="http://localhost:8080/soap/hello"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
Copy to Clipboard Toggle word wrap

Second, let’s send a SOAP request to the service:

$ curl -v -X POST -H "Content-Type: text/xml;charset=UTF-8" \
    -d \
      '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body><ns2:hello xmlns:ns2="http://server.it.cxf.quarkiverse.io/"><arg0>World</arg0></ns2:hello></soap:Body>
       </soap:Envelope>' \
    http://localhost:8080/soap/hello
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ns1:helloResponse xmlns:ns1="http://server.it.cxf.quarkiverse.io/">
      <return>Hello World!</return>
    </ns1:helloResponse>
  </soap:Body>
</soap:Envelope>
Copy to Clipboard Toggle word wrap

You can see the expected <return>Hello World!</return> in the SOAP response.

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.

Tip

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>
Copy to Clipboard Toggle word wrap

Enable SOAP payload logging in application.properties

quarkus.cxf.endpoint."/hello".features=org.apache.cxf.ext.logging.LoggingFeature
Copy to Clipboard Toggle word wrap

After that you can send a new SOAP request and see some SOAP payloads in the application console:

2023-01-11 22:12:21,315 INFO  [org.apa.cxf.ser.Hel.REQ_IN] (vert.x-worker-thread-0) REQ_IN
    Address: http://localhost:8080/soap/hello
    HttpMethod: POST
    Content-Type: text/xml;charset=UTF-8
    ExchangeId: af10747a-8477-4c17-bf5f-2a4a3a95d61c
    ServiceName: HelloService
    PortName: HelloServicePort
    PortTypeName: HelloService
    Headers: {Accept=*/*, User-Agent=curl/7.79.1, content-type=text/xml;charset=UTF-8, Host=localhost:8080, Content-Length=203, x-quarkus-hot-deployment-done=true}
    Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body><ns2:hello xmlns:ns2="http://server.it.cxf.quarkiverse.io/"><arg0>World</arg0></ns2:hello></soap:Body>
</soap:Envelope>


2023-01-11 22:12:21,327 INFO  [org.apa.cxf.ser.Hel.RESP_OUT] (vert.x-worker-thread-0) RESP_OUT
    Address: http://localhost:8080/soap/hello
    Content-Type: text/xml
    ResponseCode: 200
    ExchangeId: af10747a-8477-4c17-bf5f-2a4a3a95d61c
    ServiceName: HelloService
    PortName: HelloServicePort
    PortTypeName: HelloService
    Headers: {}
    Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:helloResponse xmlns:ns1="http://server.it.cxf.quarkiverse.io/"><return>Hello World!</return></ns1:helloResponse></soap:Body></soap:Envelope>
Copy to Clipboard Toggle word wrap
5.1.2.3. Further steps

You may want to proceed with packaging your application for running on a JVM or natively.

5.1.3. Your first SOAP Client on Quarkus

In this guide we explain how to create a simple Quarkus application acting as a client of a remote Web service.

Create project first

Follow the Project creation guide before proceeding here.

5.1.3.1. Remote Web service for testing

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
Copy to Clipboard Toggle word wrap

Once the container is up and running, we can inspect its WSDL

$ curl -s http://localhost:8082/calculator-ws/CalculatorService?wsdl
<?xml version="1.0" ?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.jboss.org/eap/quickstarts/wscalculator/Calculator" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="CalculatorService" targetNamespace="http://www.jboss.org/eap/quickstarts/wscalculator/Calculator">

  ...

  <wsdl:binding name="CalculatorServiceSoapBinding" type="tns:CalculatorService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
    <wsdl:operation name="add">
      <soap:operation soapAction="" style="document"></soap:operation>
      <wsdl:input name="add">
        <soap:body use="literal"></soap:body>
      </wsdl:input>
      <wsdl:output name="addResponse">
        <soap:body use="literal"></soap:body>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="subtract">
      <soap:operation soapAction="" style="document"></soap:operation>
      <wsdl:input name="subtract">
        <soap:body use="literal"></soap:body>
      </wsdl:input>
      <wsdl:output name="subtractResponse">
        <soap:body use="literal"></soap:body>
      </wsdl:output>
    </wsdl:operation>

    ...

  </wsdl:binding>

  ...

</wsdl:definitions>
Copy to Clipboard Toggle word wrap

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:

$ curl -s \
    -X POST \
    -H "Content-Type: text/xml;charset=UTF-8" \
    -d \
        '<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
            <Body>
                <add xmlns="http://www.jboss.org/eap/quickstarts/wscalculator/Calculator">
                    <arg0 xmlns="">7</arg0> 
1

                    <arg1 xmlns="">4</arg1>
                </add>
            </Body>
        </Envelope>' \
    http://localhost:8082/calculator-ws/CalculatorService
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ns2:addResponse xmlns:ns2="http://www.jboss.org/eap/quickstarts/wscalculator/Calculator">
      <return>11</return> 
2

    </ns2:addResponse>
  </soap:Body>
</soap:Envelope>
Copy to Clipboard Toggle word wrap
1
The request to add 7 and 4
2
11 - return value of the operation
5.1.3.2. SOAP client

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.

Tip

If you want to use this approach, first follow the Generate Java from WSDL section and then continue with the next steps.

5.1.3.3. Using SEI as a client

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

package io.quarkiverse.cxf.client.it;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;

import org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService;

import io.quarkiverse.cxf.annotation.CXFClient;

@Path("/cxf/calculator-client")
public class CxfClientRestResource {

    @CXFClient("myCalculator") 
1

    CalculatorService myCalculator;

    @GET
    @Path("/add")
    @Produces(MediaType.TEXT_PLAIN)
    public int add(@QueryParam("a") int a, @QueryParam("b") int b) {
        return myCalculator.add(a, b); 
2

    }

}
Copy to Clipboard Toggle word wrap

1
Let the CDI container inject an instance of the client. @CXFClient("myCalculator") is actually equivalent to @Inject @CXFClient("myCalculator")
2
Invoke the add operation thus calling the remote Web service

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
Copy to Clipboard Toggle word wrap

Tip

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
Copy to Clipboard Toggle word wrap

and test it by sending some requests to it:

$ curl -s 'http://localhost:8080/cxf/calculator-client/add?a=5&b=6'
11
Copy to Clipboard Toggle word wrap

where 11 is the correct result of adding 5 and 6.

5.1.3.4. Further steps

You may want to proceed with

5.1.4. Configuration

Quarkus CXF exposes a large number of configuration options. Each extension documents its options at the bottom of its reference page.

The configuration options can be set in application.properties file or via environment variables - see Quarkus configuration reference for details.

5.1.4.1. Bean references

Several configuration options of Quarkus CXF allow referring to beans present in Quarkus CDI container. Features and interceptors are typical examples of those.

There are two ways how to set a bean reference in the configuration: by type or by bean name.

5.1.4.1.1. Bean reference by type

Here is an example:

application.properties

# bean reference by type
quarkus.cxf.endpoint."/hello".features = org.apache.cxf.ext.logging.LoggingFeature
Copy to Clipboard Toggle word wrap

When using a reference by type name, the resolution proceeds as follows:

  • Fist the bean is looked up in Quarkus CDI container by type.
  • If the bean is available, it is used.
  • If multiple beans assignable to the given type, then an exception is thrown.
  • If no matching bean is available, then the class is loaded and an attempt is performed to instantiate it using its default constructor.
5.1.4.1.2. Bean reference by bean name

Here is an example:

application.properties

# bean reference by bean name
quarkus.cxf.endpoint."/fruit".features = #myCustomLoggingFeature
Copy to Clipboard Toggle word wrap

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:

import org.apache.cxf.ext.logging.LoggingFeature;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;

class Producers {

    @Produces
    @ApplicationScoped
    @Named("myCustomLoggingFeature")
    LoggingFeature myCustomLoggingFeature() {
        LoggingFeature loggingFeature = new LoggingFeature();
        loggingFeature.setPrettyLogging(true);
        return loggingFeature;
    }
}
Copy to Clipboard Toggle word wrap

5.1.5. Package for running on a JVM or natively

In this chapter, we explain how to package a Quarkus CXF application for running on a JVM or for running it natively.

5.1.5.1. JVM mode

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
Copy to Clipboard Toggle word wrap

The libraries needed to run the application on a JVM can be found in target/quarkus-app directory:

$ ls -lh target/quarkus-app
drwxr-xr-x. 2 ppalaga ppalaga 4.0K Jan 12 22:29 app
drwxr-xr-x. 4 ppalaga ppalaga 4.0K Jan 12 22:29 lib
drwxr-xr-x. 2 ppalaga ppalaga 4.0K Jan 12 22:29 quarkus
-rw-r-r--. 1 ppalaga ppalaga 6.1K Jan 12 22:29 quarkus-app-dependencies.txt
-rw-r-r--. 1 ppalaga ppalaga  678 Jan 12 22:29 quarkus-run.jar
Copy to Clipboard Toggle word wrap

We can start the application as follows:

$ java -jar target/quarkus-app/quarkus-run.jar
Copy to Clipboard Toggle word wrap

You can send some SOAP requests using curl to make sure that the application works.

5.1.5.2. Native mode

Quarkus offers first class support for building GraalVM native images and Quarkus CXF fully honors that promise too.

Images

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:

<profile>
  <id>native</id>
  <activation>
    <property>
      <name>native</name>
    </property>
  </activation>
  <properties>
    <skipITs>false</skipITs>
    <quarkus.package.type>native</quarkus.package.type>
  </properties>
</profile>
Copy to Clipboard Toggle word wrap

Further, as mentioned in the Section 5.1.1, “Create a new project” section, you need the GraalVM native-image tool.

You should either have it installed locally and have GRAALVM_HOME environment variable set properly, or — if you only need to produce a Linux native executable — you can use docker.

With local installation of GraalVM

# Make sure $GRAALVM_HOME is set properly
$ echo $GRAALVM_HOME
/home/{user}/.sdkman/candidates/java/{major}.{minor}.r{java-version}-grl

# Produce the native executable
mvn package -Pnative
Copy to Clipboard Toggle word wrap

Tip

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
Copy to Clipboard Toggle word wrap

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
...
Copy to Clipboard Toggle word wrap

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
...
Copy to Clipboard Toggle word wrap

Again, you can send some SOAP requests using curl to make sure that the native executable works.

Do not forget to compare the memory usage, time to first request and other performance metrics with the stack you used before and share your results!

5.1.5.3. Native Image: Additional Resources

You may also refer to the links below which contain tips on how to work with native images.

5.1.5.4. Create container image

Refer to Quarkus Container image guide.

5.1.6. Logging

Refer to Quarkus Logging guide for basic information about logging on Quarkus, such as

5.1.6.1. Payload logging
History

Since Quarkus CXF 2.6.0, the payload logging functionality is available via io.quarkiverse.cxf:quarkus-cxf extension. Before 2.6.0, it was available through a separate extension io.quarkiverse.cxf:quarkus-cxf-rt-features-logging which is now deprecated and will be removed in the future.

The payload logging functionality is implemented primarily through the org.apache.cxf.ext.logging.LoggingFeature class.

There are several ways how you can set the feature on a client or service endpoint.

5.1.6.2.1. Global settings

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
Copy to Clipboard Toggle word wrap

All logging configuration options are listed on quarkus-cxf reference page.

Tip

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).

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

# For a service:
quarkus.cxf.endpoint."/hello".logging.enabled = true
quarkus.cxf.endpoint."/hello".logging.pretty = true
# For a client:
quarkus.cxf.client.hello.logging.enabled = true
quarkus.cxf.client.hello.logging.pretty = true
Copy to Clipboard Toggle word wrap

All logging configuration options are documented on quarkus-cxf reference page:

To attach an instance with default settings, you can do one of the following:

  1. 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
    Copy to Clipboard Toggle word wrap
    Tip

    There is an example in Your first SOAP Web service chapter of the User guide.

    or alternatively

  2. Use the @Features annotation of CXF:

    @org.apache.cxf.feature.Features (features = {"org.apache.cxf.ext.logging.LoggingFeature"})
    @WebService(endpointInterface = "org.acme.SayHi", targetNamespace = "uri:org.acme")
    public class SayHiImplementation implements SayHi {
       public long sayHi(long arg) {
           return arg;
       }
       //...
    }
    Copy to Clipboard Toggle word wrap
5.1.6.3.1. Producing a custom LoggingFeature bean

If you need some custom logic to setup the LoggingFeature, you can produce a named LoggingFeature bean:

import org.apache.cxf.ext.logging.LoggingFeature;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;

class Producers {

    @Produces
    @ApplicationScoped
    @Named("limitedLoggingFeature") // "limitedLoggingFeature" is redundant if the name of the method is the same
    LoggingFeature limitedLoggingFeature() {
        LoggingFeature loggingFeature = new LoggingFeature();
        loggingFeature.setPrettyLogging(true);
        loggingFeature.setLimit(1024);
        return loggingFeature;
    }
}
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

5.1.7. Complex SOAP payloads with JAXB

Our introductory guides for Quarkus SOAP client and SOAP service dealt with services having only primitive parameters and return values such as integers and strings. Let’s have a look at passing and receiving more complex objects.

As an example, let’s create an application for managing fruits.

Note

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:

package io.quarkiverse.cxf.it.server;

import java.util.Objects;

import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;

@XmlType(name = "Fruit")
@XmlRootElement
public class Fruit {

    private String name;

    private String description;

    public Fruit() {
    }

    public Fruit(String name, String description) {
        this.name = name;
        this.description = description;
    }

    public String getName() {
        return name;
    }

    @XmlElement
    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    @XmlElement
    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Fruit)) {
            return false;
        }

        Fruit other = (Fruit) obj;

        return Objects.equals(other.getName(), this.getName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.getName());
    }
}
Copy to Clipboard Toggle word wrap

As you may have noticed, we have used some JAXB annotations, such as @XmlElement, @XmlRootElement and @XmlType. This is to control the serialization and deserialization of the bean from and to XML.

5.1.7.1. Automatic registration for reflection

JAXB is a reflection based serialization framework. When learning about GraalVM native images, one of the first things you typically hear is that you have to register classes, fields and methods for reflection at build time. With plain GraalVM you’d have to do this through reflection-config.json manually. Well, at least for the classes you have written yourself. Not so with Quarkus. quarkus-jaxb extension (which quarkus-cxf depends on) is able to scan your application’s class path for classes annotated with JAXB annotations and register them for reflection automatically.

Hence working with complex payloads on Quarkus is not different from stock CXF. The JAXB serialization and deserialization will work out of the box without any additional configuration.

5.1.7.2. SEI and implementation

The Service Endpoint Interface (SEI) for managing fruits might look like the following:

package io.quarkiverse.cxf.it.server;

import java.util.Set;

import jakarta.jws.WebMethod;
import jakarta.jws.WebService;

@WebService
public interface FruitService {

    @WebMethod
    Set<Fruit> list();

    @WebMethod
    Set<Fruit> add(Fruit fruit);

    @WebMethod
    Set<Fruit> delete(Fruit fruit);
}
Copy to Clipboard Toggle word wrap

We can implement the SEI as simply as possible:

package io.quarkiverse.cxf.it.server;

import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;

import jakarta.jws.WebService;

@WebService(serviceName = "FruitService")
public class FruitServiceImpl implements FruitService {

    private Set<Fruit> fruits = Collections.synchronizedSet(new LinkedHashSet<>());

    public FruitServiceImpl() {
        fruits.add(new Fruit("Apple", "Winter fruit"));
        fruits.add(new Fruit("Pineapple", "Tropical fruit"));
    }

    @Override
    public Set<Fruit> list() {
        return fruits;
    }

    @Override
    public Set<Fruit> add(Fruit fruit) {
        fruits.add(fruit);
        return fruits;
    }

    @Override
    public Set<Fruit> delete(Fruit fruit) {
        fruits.remove(fruit);
        return fruits;
    }
}
Copy to Clipboard Toggle word wrap
5.1.7.3. application.properties

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
Copy to Clipboard Toggle word wrap
5.1.7.4. Test with Quarkus dev mode and curl

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
Copy to Clipboard Toggle word wrap

and then check whether the service is working by invoking its list operation:

$ curl -v -X POST -H "Content-Type: text/xml;charset=UTF-8" \
    -d \
      '<soapenv:Envelope
      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:ns1="http://server.it.cxf.quarkiverse.io/">
        <soapenv:Body>
            <ns1:list/>
        </soapenv:Body>
    </soapenv:Envelope>' \
    http://localhost:8080/soap/fruits
...
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ns1:listResponse xmlns:ns1="http://server.it.cxf.quarkiverse.io/">
      <return xmlns:ns2="http://server.it.cxf.quarkiverse.io/">
        <description>Winter fruit</description>
        <name>Apple</name>
      </return>
      <return xmlns:ns2="http://server.it.cxf.quarkiverse.io/">
        <description>Tropical fruit</description>
        <name>Pineapple</name>
      </return>
    </ns1:listResponse>
  </soap:Body>
</soap:Envelope>
Copy to Clipboard Toggle word wrap

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:

$ curl -v -X POST -H "Content-Type: text/xml;charset=UTF-8" \
    -d \
     '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
          <ns2:add xmlns:ns2="http://server.it.cxf.quarkiverse.io/">
            <arg0>
              <description>Mediterranean fruit</description>
              <name>Orange</name>
            </arg0>
          </ns2:add>
       </soap:Body></soap:Envelope>' \
    http://localhost:8080/soap/fruits
...
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ns1:addResponse xmlns:ns1="http://server.it.cxf.quarkiverse.io/">
      <return xmlns:ns2="http://server.it.cxf.quarkiverse.io/">
        <description>Winter fruit</description>
        <name>Apple</name>
      </return>
      <return xmlns:ns2="http://server.it.cxf.quarkiverse.io/">
        <description>Tropical fruit</description>
        <name>Pineapple</name>
      </return>
      <return xmlns:ns2="http://server.it.cxf.quarkiverse.io/">
        <description>Mediterranean fruit</description>
        <name>Orange</name>
      </return>
    </ns1:addResponse>
  </soap:Body>
</soap:Envelope>
Copy to Clipboard Toggle word wrap

We can see Orange having been added in the returned list as expected.

5.1.7.5. Further steps

You may want to proceed with packaging your application for running on a JVM or natively.

5.1.8. Contract first and code first approaches

Both contract first and code first development modes are fully supported by Quarkus CXF.

5.1.8.1. Contract first client

A SOAP service is described by WSDL. It is a contract defining operations, their parameters and return values, etc. WSDL is rich enough to be used for generating the code of a complete client. CXF provides the wsdl2java utility for that.

Quarkus CXF wraps wsdl2java in the quarkus-cxf extension so you do not need to use it directly.

Follow the Generate the Model classes from WSDL section of the user guide for more details about how to use it.

You may also want to check the CXF Developing a Consumer as a general introduction.

5.1.8.2. Contract first service

When implementing a service the generation of Java code from WSDL may also come in handy. wsdl2java can generate the model classes (with JAXB annotations) and service interfaces (with JAX-WS annotations) for you. Your task is then to provide implementations for those interfaces.

You may want to check the WSDL First Service Development section of CXF documentation for a better understanding of the underlying concepts.

5.1.8.3. Code first service

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:

  1. Start your service and point your clients at http://your-host/your-service?wsdl
  2. Generate the WSDL document from Java classes at build time
Tip

Check the Code first development section of CXF documentation for further information.

5.1.8.4. Generate the Model classes from WSDL

quarkus-cxf extension supports generating Java classes from WSDL during Quarkus code generation phase.

Code examples

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-cxf dependency in your project
  • For Maven projects, the generate-code goal needs to be present in the configuration of quarkus-maven-plugin:

    pom.xml

                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>build</goal>
                                <goal>generate-code</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
    Copy to Clipboard Toggle word wrap

  • For Gradle projects no additional configurarion of io.quarkus plugin is needed
  • Put your WSDL files under src/main/resources or src/test/resources or 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 under src/main/resources/wsdl or src/test/resources/wsdl, set it as follows:

    application.properties

    quarkus.cxf.codegen.wsdl2java.includes = wsdl/*.wsdl
    Copy to Clipboard Toggle word wrap

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

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

# Parameters for foo.wsdl
quarkus.cxf.codegen.wsdl2java.foo-params.includes = wsdl/foo.wsdl
quarkus.cxf.codegen.wsdl2java.foo-params.wsdl-location = wsdl/foo.wsdl
# Parameters for bar.wsdl
quarkus.cxf.codegen.wsdl2java.bar-params.includes = wsdl/bar.wsdl
quarkus.cxf.codegen.wsdl2java.bar-params.wsdl-location = wsdl/bar.wsdl
quarkus.cxf.codegen.wsdl2java.bar-params.xjc = ts
Copy to Clipboard Toggle word wrap

Tip

Add io.quarkiverse.cxf:quarkus-cxf-xjc-plugins dependency to your project to be able to use -xjc-Xbg, -xjc-Xdv, -xjc-Xjavadoc, -xjc-Xproperty-listener, -xjc-Xts and -xjc-Xwsdlextension wsdl2java parameters.

5.1.8.4.1. Non ASCII Characters

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)
Copy to Clipboard Toggle word wrap

Below is an example of auto-generated non ASCII characters in a Java class:

@XmlType(name = "OperationOrderStatusType")
@XmlEnum
public enum OperationOrderStatusType {

    @XmlEnumValue("Cr\u00e9\u00e9")
    CRÉÉ("Cr\u00e9\u00e9"),
    @XmlEnumValue("A communiquer")
    A_COMMUNIQUER("A communiquer"),
    @XmlEnumValue("En attente de r\u00e9ponse")
    EN_ATTENTE_DE_RÉPONSE("En attente de r\u00e9ponse"),
    @XmlEnumValue("Attribu\u00e9")
    ATTRIBUÉ("Attribu\u00e9"),
    @XmlEnumValue("Clotur\u00e9")
    CLOTURÉ("Clotur\u00e9"),
    @XmlEnumValue("Annul\u00e9")
    ANNULÉ("Annul\u00e9");
    private final String value;

    OperationOrderStatusType(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static OperationOrderStatusType fromValue(String v) {
        for (OperationOrderStatusType c: OperationOrderStatusType.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }
}
Copy to Clipboard Toggle word wrap

Anything starting with \u will be a problem. Consequently the following refactoring is needed:

@XmlType(name = "OperationOrderStatusType")
@XmlEnum
public enum OperationOrderStatusType {

    @XmlEnumValue("Créé")
    CREE("Créé"),
    @XmlEnumValue("A communiquer")
    A_COMMUNIQUER("A communiquer"),
    @XmlEnumValue("En attente de réponse")
    EN_ATTENTE_DE_REPONSE("En attente de réponse"),
    @XmlEnumValue("Attribué")
    ATTRIBUE("Attribué"),
    @XmlEnumValue("Cloturé")
    CLOTURE("Cloturé"),
    @XmlEnumValue("Annulé")
    ANNULE("Annulé");
    private final String value;

    OperationOrderStatusType(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static OperationOrderStatusType fromValue(String v) {
        for (OperationOrderStatusType c: OperationOrderStatusType.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }
}
Copy to Clipboard Toggle word wrap
5.1.8.5. Generate WSDL document from Java

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:

Note

The sample code snippets used in this section come from the server integration test in the source tree of Quarkus CXF

application.properties

quarkus.cxf.java2ws.includes = io.quarkiverse.cxf.it.server.HelloServiceImpl,io.quarkiverse.cxf.it.server.FaultyHelloServiceImpl
quarkus.cxf.java2ws.wsdl-name-template = %TARGET_DIR%/Java2wsTest/%SIMPLE_CLASS_NAME%-from-java2ws.wsdl
Copy to Clipboard Toggle word wrap

Here we have instructed java2ws to generate WSDLs for two service classes, namely HelloServiceImpl and FaultyHelloServiceImpl.

Annotations

The service classes must be annotated with jakarta.xml.ws.WebService to be selected for java2ws processing.

The two generated WSDL documents will be stored as target/Java2wsTest/FaultyHelloServiceImpl-from-java2ws.wsdl and target/Java2wsTest/HelloServiceImpl-from-java2ws.wsdl respectively.

Note

Unlike wsdl2java which is executed within Quarkus source generation phase, java2ws is a part Quarkus augmentation that happens after compilation. The input of java2ws are, after all, Java class files. Hence you do not need to add <goal>generate-code</goal> to quarkus-maven-plugin for java2ws.

5.1.8.5.1. See also

Check the following chapters to learn a bout various ways to customize the processing of SOAP requests and responses:

5.1.9.1. CXF Interceptors and Features

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.

@org.apache.cxf.feature.Features (features = {"org.apache.cxf.ext.logging.LoggingFeature"})
@org.apache.cxf.interceptor.InInterceptors (interceptors = {"org.acme.Test1Interceptor" })
@org.apache.cxf.interceptor.InFaultInterceptors (interceptors = {"org.acme.Test2Interceptor" })
@org.apache.cxf.interceptor.OutInterceptors (interceptors = {"org.acme.Test1Interceptor" })
@org.apache.cxf.interceptor.InFaultInterceptors (interceptors = {"org.acme.Test2Interceptor","org.acme.Test3Intercetpor" })
@WebService(endpointInterface = "org.acme.SayHi", targetNamespace = "uri:org.acme")
public class SayHiImplementation implements SayHi {
   public long sayHi(long arg) {
       return arg;
   }
   //...
}
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap
Class loading

Both feature and interceptor classes are loaded via CDI first. They can be referenced by fully a qualified class name or by a bean name.

If no CDI beans are available, the constructor without parameters will be invoked to instantiate each class.

5.1.9.2. JAX-WS Handlers

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
Copy to Clipboard Toggle word wrap

Where MySOAPHandler could look like below:

import jakarta.xml.ws.handler.soap.SOAPHandler;
import jakarta.xml.ws.handler.soap.SOAPMessageContext;

public class MySOAPHandler implements SOAPHandler<SOAPMessageContext> {

    public boolean handleMessage(SOAPMessageContext messageContext) {
        SOAPMessage msg = messageContext.getMessage();
        return true;
    }
    // other methods
}
Copy to Clipboard Toggle word wrap
Class loading

The SOAPHandler classes are loaded via CDI first..

If no CDI beans are available, the constructor without parameters will be invoked to instantiate each class.

5.1.10. Advanced service topics

Check the following chapters for more details about implementing SOAP service endpoints:

5.1.10.1. Service endpoints and paths

Let’s explain how a service endpoint can be exposed under a certain URL path.

In the First SOAP Web service chapter, we explained how to expose a service using application.properties:

application.properties

# The context path under which all services will be available
quarkus.cxf.path = /soap

# Publish "HelloService" under the context path /${quarkus.cxf.path}/hello
quarkus.cxf.endpoint."/hello".implementor = io.quarkiverse.cxf.it.server.HelloServiceImpl
quarkus.cxf.endpoint."/hello".features = org.apache.cxf.ext.logging.LoggingFeature
Copy to Clipboard Toggle word wrap

With this setup in place, the io.quarkiverse.cxf.it.server.HelloServiceImpl will be accessible under http://localhost:8080/soap/hello.

This is the traditional way that worked since the very beginning of Quarkus CXF.

Since Quarkus CXF 3.11.0, there is a new way to expose an endpoint under a specific path: the @io.quarkiverse.cxf.annotation.CXFEndpoint annotation. The path is set through its non-optional attribute value and it is relative to quarkus.cxf.path much like when this is done via application.properties.

Let’s have a look at an example.

Note

The sample code snippet shown in this section comes from the Client and server integration test in the source tree of Quarkus CXF. You may want to use it as a runnable example.

PathAnnotationHelloServiceImpl.java

package io.quarkiverse.cxf.it.annotation.cxfendpoint;

import jakarta.jws.WebService;

import io.quarkiverse.cxf.annotation.CXFEndpoint;
import io.quarkiverse.cxf.it.HelloService;

@CXFEndpoint("/path-annotation") 
1

@WebService(serviceName = "HelloService", targetNamespace = HelloService.NS)
public class PathAnnotationHelloServiceImpl implements HelloService {
    @Override
    public String hello(String person) {
        return "Hello " + person + " from PathAnnotationHelloServiceImpl!";
    }
}
Copy to Clipboard Toggle word wrap

1
If the value of quarkus.cxf.path in application.properties is /soap, then this service will be accessible under http://localhost:8080/soap/path-annotation.

@CXFEndpoint("/my-path") annotation on MyServiceImpl type is equivalent to the quarkus.cxf.endpoint."/my-path".implementor = org.acme.MyServiceImpl line in application.properties. Therefore it is enough to use just one of them.

Other options set in application.properties for the /my-path endpoint will combine just fine with @CXFEndpoint("/my-path").

The @CXFEndpoint annotation can also be used on producer methods. This comes in handy especially when testing clients, because the returned implementation can be a mock.

Here is an example:

MockedEndpointTest.java

package io.quarkiverse.cxf.it.annotation.cxfendpoint;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import io.quarkiverse.cxf.annotation.CXFClient;
import io.quarkiverse.cxf.annotation.CXFEndpoint;
import io.quarkiverse.cxf.it.HelloService;
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
public class MockedEndpointTest {

    @CXFEndpoint("/helloMock") 
1

    HelloService helloMockService() {
        final HelloService result = Mockito.mock(HelloService.class);
        Mockito.when(result.hello("Mock")).thenReturn("Hello Mock!");
        return result;
    }

    @CXFClient("helloMock") 
2

    HelloService helloMockClient;

    @Test
    void helloMock() {
        Assertions.assertThat(helloMockClient.hello("Mock")).isEqualTo("Hello Mock!"); 
3

    }

}
Copy to Clipboard Toggle word wrap

1
Here we use the @CXFEndpoint annotation on a method that returns a mock of the HelloService interface. The @jakarta.enterprise.inject.Produces annotation is not required, because Quarkus CXF declares @CXFEndpoint as a bean defining annotation.
2
The client is configured in application.properties to connect to http://localhost:8080/soap/helloMock
3
The assertion makes sure that the service implementation works as expected.
5.1.10.2. JAX-WS Providers

JAX-WS Providers are fully supported, and can be implemented as shown below.

Given the following sample Provider implementation:

import jakarta.xml.transform.stream.StreamSource;
import jakarta.xml.ws.BindingType;
import jakarta.xml.ws.Provider;
import jakarta.xml.ws.Service;
import jakarta.xml.ws.ServiceMode;
import jakarta.xml.ws.WebServiceProvider;
import java.io.StringReader;

@WebServiceProvider
@ServiceMode(value = Service.Mode.PAYLOAD)
public class StreamSourcePayloadProvider implements Provider<StreamSource> {

    public StreamSourcePayloadProvider() {
    }

    public StreamSource invoke(StreamSource request) {
        String payload = StaxUtils.toString(request);

        // Do some interesting things ...

        StreamSource response = new StreamSource(new StringReader(payload));
        return response;
    }
}
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap
Class loading

Provider classes are loaded via CDI first..

If no CDI beans are available, the constructor without parameters will be invoked to instantiate each class.

5.1.10.3. REST and SOAP Endpoints

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:

package org.acme.cxf;

import ...

@Slf4j
@WebService(endpointInterface = "org.acme.cxf.WeatherWebService")
public class WeatherWebServiceImpl implements WeatherWebService {

    @Inject
    BackEndWeatherService backEndWeatherService;

    private Map<String, DailyTemperature> dailyTempByZipCode = Collections.synchronizedMap(new LinkedHashMap<>());

    public WeatherWebServiceImpl() {
        this.dailyTempByZipCode.addAll(
                this.backEndWeatherService.getDailyForecast(Instant.now()));
    }

    @Override
    public DailyTemperature estimationTemperatures(String zipCode) {
        log.info("Daily estimation temperatures forecast called with '{}' zip code paramter", zipCode);
        return this.dailyTempByZipCode.get(zipCode);
    }
}
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

Now, imagine the following RESTEasy endpoint:

package org.acme.reasteasy;

import ...

@Slf4j
@Path("/healthcheck")
public class HealthCheckResource {

    @Inject
    BackEndWeatherService backEndWeatherService;

    @GET
    public Response doHealthCheck() {
        if(this.backEndWeatherService.isAvailable()) {
            return Response.ok().build();
        } else {
            return Response.status(Response.Status.SERVICE_UNAVAILABLE);
        }
    }
}
Copy to Clipboard Toggle word wrap

You can separate your REST endpoint by configuring the REASTEasy path:

quarkus.resteasy.path=/rest
Copy to Clipboard Toggle word wrap

You should now be able to send requests to both your REST and SOAP endpoints deployed within a single project, at:

5.1.10.4. Running behind a reverse proxy

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.

Tip

Refer to Quarkus HTTP reference for more details.

Quarkus CXF support for various X-Forwarded headers works in line with Quarkus configuration.

Important

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-Proto and X-Forwarded-Port headers will be used to set the protocol part and the port part of the URL returned by jakarta.servlet.http.HttpServletRequest.getRequestURL() respectively.
    • If enabled, the value passed via X-Forwarded-For will be returned by jakarta.servlet.ServletRequest.getRemoteAddr().
  • quarkus.http.proxy.enable-forwarded-host - enable the rewriting of the host part of URL returned by jakarta.servlet.http.HttpServletRequest.getRequestURL(). The actual host name is taken from the header configured via quarkus.http.proxy.forwarded-host-header (default is X-Forwarded-Host).
  • quarkus.http.proxy.enable-forwarded-prefix - enable the rewriting of the path part of the URL returned by jakarta.servlet.http.HttpServletRequest.getRequestURL() and of the URI returned by jakarta.servlet.http.HttpServletRequest.getRequestURI(). The actual path prefix is taken from the header configured via quarkus.http.proxy.forwarded-prefix-header (default is X-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
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

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"/>
...
Copy to Clipboard Toggle word wrap

5.1.11. Advanced SOAP client topics

Check the following chapters for more details about implementing SOAP clients:

5.1.11.1. client-endpoint-url defaults

If you omit the client-endpoint-url property in application.properties, the CXF Quarkus extension will assume that the service is published at http://localhost:8080/{service-path}, where {service-path} is derived from

  • Configuration property quarkus.cxf.path (if specified); and the
  • SEI’s class name in lower case

Given quarkus.cxf.path = /ws, the default effective client-endpoint-url of the CalculatorService would be http://localhost:8080/ws/org.jboss.eap.quickstarts.wscalculator.calculator.calculatorservice.

If quarkus.cxf.path is not specified, the client-endpoint-url would be just http://localhost:8080/org.jboss.eap.quickstarts.wscalculator.calculator.calculatorservice.

5.1.11.2. Configure multiple clients

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

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

# another client
quarkus.cxf.client.anotherCalculator.wsdl = https://acme.com/ws/WeatherService?wsdl
quarkus.cxf.client.anotherCalculator.client-endpoint-url = https://acme.com/ws/WeatherService
quarkus.cxf.client.anotherCalculator.service-interface = org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService
Copy to Clipboard Toggle word wrap

Quarkus CXF produces all clients injected via @io.quarkiverse.cxf.annotation.CXFClient in the default @Dependent scope. Due to that, the real scope of the injected instance depends on the CDI scope of the bean into which the client is injected.

Therefore, if the client is injected into an @ApplicationScoped bean, then the client instance also becomes @ApplicationScoped. If the client is injected into an @RequestScoped bean, then the client instance also becomes @RequestScoped.

This behavior comes in handy if you need to configure clients dynamically after the application was started.

To configure all clients at application startup, you can implement an HTTPConduitConfigurer and set it on the CXF Bus in an StartupEvent observer method.

In the example snippet below, we configure some aspects of the HTTPClientPolicy. The same approach can be leveraged to customize also AuthorizationPolicy, ProxyAuthorizationPolicy or even TLSClientParameters of your clients.

import io.quarkus.runtime.StartupEvent;
import jakarta.enterprise.event.Observes;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transport.http.HTTPConduitConfigurer;
...

void onStart(@Observes StartupEvent ev) {

     HTTPConduitConfigurer httpConduitConfigurer = new HTTPConduitConfigurer() {
         public void configure(String name, String address, HTTPConduit conduit) {
             conduit.getClient().setAllowChunking(false);
             conduit.getClient().setAutoRedirect(true);
         }
     };

     final Bus bus = BusFactory.getDefaultBus();
     bus.setExtension(httpConduitConfigurer, HTTPConduitConfigurer.class);
}
Copy to Clipboard Toggle word wrap
5.1.11.5. Dynamic client configuration

Sometimes you need to reconfigure the client after the application has been started, or even before every request. This might be the case, if, for example, each request needs to be sent to a different remote URL.

CXF offers an API to set the URL of the remote endpoint. However using that API on a client instance that may be accessed from other threads can lead to race conditions.

If your client is used as a part of serving an external request, you can inject the client into a @RequestScoped bean. Then every request will be served by a fresh client instance and you can configure it safely.

For example, this solution is applicable when your client is called from a REST-handler method (see below) or from a @WebMethod that are serving external requests.

package io.quarkiverse.cxf.client.it;

import java.util.Map;

import jakarta.enterprise.context.RequestScoped;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;
import jakarta.xml.ws.BindingProvider;

import org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService;

import io.quarkiverse.cxf.annotation.CXFClient;

/*
 * The @RequestScoped annotation causes that the REST resource is instantiated
 * anew for every call of the add() method. Therefore also a new client instance
 * is injected into the calculator field for every request served by add().
 */
@RequestScoped
@Path("/cxf/dynamic-client")
public class DynamicClientConfigRestResource {

    @CXFClient("requestScopedVertxHttpClient")
    CalculatorService calculator;

    @GET
    @Path("/add")
    @Produces(MediaType.TEXT_PLAIN)
    public int add(@QueryParam("a") int a, @QueryParam("b") int b, @QueryParam("baseUri") String baseUri) {
        Map<String, Object> ctx = ((BindingProvider) calculator).getRequestContext();
        /* We are setting the remote URL safely, because the client is associated exclusively with the current request */
        ctx.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, baseUri + "/calculator-ws/CalculatorService");
        return calculator.add(a, b);
    }

}
Copy to Clipboard Toggle word wrap
5.1.11.6. Pure client applications

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
Copy to Clipboard Toggle word wrap
5.1.11.7. Prevent resource leaks

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():

import java.net.URL;
import javax.xml.namespace.QName;
import jakarta.xml.ws.Service;
import java.io.Closeable;

final URL serviceUrl = new URL("http://localhost/myService?wsdl");
final QName qName = new QName("http://acme.org/myNamespace", "MyService");
final Service service = jakarta.xml.ws.Service.create(serviceUrl, qName);
final MyService proxy = service.getPort(MyService.class);

try {
    proxy.doSomething();
} finally {
    ((Closeable) proxy).close();
}
Copy to Clipboard Toggle word wrap

5.1.12. Camel Integration

Camel Quarkus supports CXF since its version 2.12.0. Under the hood, the implementation is based on Quarkus CXF. Therefore, all functionality available in Quarkus CXF is also available in Camel Quarkus.

Refer to Camel Quarkus CXF SOAP extension documentation for further details.

5.1.13. Examples

The integration-tests folder of the codebase provides various examples that demonstrate how to use this extension extensively.

Chapter 6. Quarkus CXF security guide

This chapter provides information about security when working with Quarkus CXF extensions.

6.1. Security guide

The security guide documents various security related aspects of Quarkus CXF:

6.1.1. SSL, TLS and HTTPS

This section documents various use cases related to SSL, TLS and HTTPS.

Note

The sample code snippets used in this section come from the WS-SecurityPolicy integration test in the source tree of Quarkus CXF

6.1.1.1. Client SSL configuration

If your client is going to communicate with a server whose SSL certificate is not trusted by the client’s operating system, then you need to set up a custom trust store for your client.

Tools like openssl or Java keytool are commonly used for creating and maintaining truststores.

We have examples for both tools in the Quarkus CXF source tree:

Once you have prepared the trust store, you need to configure your client to use it.

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

# Client side SSL
quarkus.cxf.client.hello.client-endpoint-url = https://localhost:${quarkus.http.test-ssl-port}/services/hello
quarkus.cxf.client.hello.service-interface = io.quarkiverse.cxf.it.security.policy.HelloService
1

quarkus.cxf.client.hello.trust-store-type = pkcs12
2

quarkus.cxf.client.hello.trust-store = client-truststore.pkcs12
quarkus.cxf.client.hello.trust-store-password = client-truststore-password
Copy to Clipboard Toggle word wrap

1
pkcs12 and jks are two commonly used keystore formats. PKCS12 is the default Java keystore format since Java 9. We recommend using PKCS12 rather than JKS, because it offers stronger cryptographic algorithms, it is extensible, standardized, language-neutral and widely supported.
2
The referenced client-truststore.pkcs12 file has to be available either in the classpath or in the file system.
6.1.1.2. Server SSL configuration

To make your services available over the HTTPS protocol, you need to set up server keystore in the first place. The server SSL configuration is driven by Vert.x, the HTTP layer of Quarkus. Quarkus HTTP guide provides the information about the configuration options.

Here is a basic example:

application.properties

# Server side SSL
quarkus.tls.key-store.p12.path = localhost-keystore.pkcs12
quarkus.tls.key-store.p12.password = localhost-keystore-password
quarkus.tls.key-store.p12.alias = localhost
quarkus.tls.key-store.p12.alias-password = localhost-keystore-password
Copy to Clipboard Toggle word wrap

6.1.1.3. Mutual TLS (mTLS) authentication

So far, we have explained the simple or single-sided case where only the server proves its identity through an SSL certificate and the client has to be set up to trust that certificate. Mutual TLS authentication goes by letting also the client prove its identity using the same means of public key cryptography.

Hence, for the Mutual TLS (mTLS) authentication, in addition to setting up the server keystore and client truststore as described above, you need to set up the keystore on the client side and the truststore on the server side.

The tools for creating and maintaining the stores are the same and the configuration properties to use are pretty much analogous to the ones used in the Simple TLS case.

The mTLS integration test in the Quarkus CXF source tree can serve as a good starting point.

The keystores and truststores are created with openssl (or alternatively with Java Java keytool)

Here is the application.properties file:

application.properties

# Server keystore for Simple TLS
quarkus.tls.localhost-pkcs12.key-store.p12.path = localhost-keystore.pkcs12
quarkus.tls.localhost-pkcs12.key-store.p12.password = localhost-keystore-password
quarkus.tls.localhost-pkcs12.key-store.p12.alias = localhost
quarkus.tls.localhost-pkcs12.key-store.p12.alias-password = localhost-keystore-password
# Server truststore for Mutual TLS
quarkus.tls.localhost-pkcs12.trust-store.p12.path = localhost-truststore.pkcs12
quarkus.tls.localhost-pkcs12.trust-store.p12.password = localhost-truststore-password
# Select localhost-pkcs12 as the TLS configuration for the HTTP server
quarkus.http.tls-configuration-name = localhost-pkcs12

# Do not allow any clients which do not prove their indentity through an SSL certificate
quarkus.http.ssl.client-auth = required

# CXF service
quarkus.cxf.endpoint."/mTls".implementor = io.quarkiverse.cxf.it.auth.mtls.MTlsHelloServiceImpl

# CXF client with a properly set certificate for mTLS
quarkus.cxf.client.mTls.client-endpoint-url = https://localhost:${quarkus.http.test-ssl-port}/services/mTls
quarkus.cxf.client.mTls.service-interface = io.quarkiverse.cxf.it.security.policy.HelloService
quarkus.cxf.client.mTls.key-store = target/classes/client-keystore.pkcs12
quarkus.cxf.client.mTls.key-store-type = pkcs12
quarkus.cxf.client.mTls.key-store-password = client-keystore-password
quarkus.cxf.client.mTls.key-password = client-keystore-password
quarkus.cxf.client.mTls.trust-store = target/classes/client-truststore.pkcs12
quarkus.cxf.client.mTls.trust-store-type = pkcs12
quarkus.cxf.client.mTls.trust-store-password = client-truststore-password

# Include the keystores in the native executable
quarkus.native.resources.includes = *.pkcs12,*.jks
Copy to Clipboard Toggle word wrap

6.1.1.4. Enforce SSL through WS-SecurityPolicy

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

<?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy wsp:Id="HttpsSecurityServicePolicy"
            xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <wsp:ExactlyOne>
        <wsp:All>
            <sp:TransportBinding>
                <wsp:Policy>
                    <sp:TransportToken>
                        <wsp:Policy>
                            <sp:HttpsToken RequireClientCertificate="false" />
                        </wsp:Policy>
                    </sp:TransportToken>
                    <sp:IncludeTimestamp />
                    <sp:AlgorithmSuite>
                        <wsp:Policy>
                            <sp:Basic128 />
                        </wsp:Policy>
                    </sp:AlgorithmSuite>
                </wsp:Policy>
            </sp:TransportBinding>
        </wsp:All>
    </wsp:ExactlyOne>
</wsp:Policy>
Copy to Clipboard Toggle word wrap

The policy has to be referenced from a service endpoint interface (SEI):

HttpsPolicyHelloService.java

package io.quarkiverse.cxf.it.security.policy;

import jakarta.jws.WebMethod;
import jakarta.jws.WebService;

import org.apache.cxf.annotations.Policy;

/**
 * A service implementation with a transport policy set
 */
@WebService(serviceName = "HttpsPolicyHelloService")
@Policy(placement = Policy.Placement.BINDING, uri = "https-policy.xml")
public interface HttpsPolicyHelloService extends AbstractHelloService {

    @WebMethod
    @Override
    public String hello(String text);

}
Copy to Clipboard Toggle word wrap

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
 ...
Copy to Clipboard Toggle word wrap

6.1.2. Authentication and authorization

Note

The sample code snippets shown in this section come from the Client and server integration test in the source tree of Quarkus CXF. You may want to use it as a runnable example.

6.1.2.1. Client HTTP basic authentication

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
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap

6.1.2.2. Mutual TLS (mTLS) authentication

See the Mutual TLS (mTLS) authentication section in SSL, TLS and HTTPS guide.

6.1.2.3. Securing service endpoints

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-file dependency as an Identity provider
  • Basic authentication enabled and users with their roles configured in application.properties:

    application.properties

    quarkus.http.auth.basic = true
    quarkus.security.users.embedded.enabled = true
    quarkus.security.users.embedded.plain-text = true
    quarkus.security.users.embedded.users.alice = alice123
    quarkus.security.users.embedded.roles.alice = admin
    quarkus.security.users.embedded.users.bob = bob234
    quarkus.security.users.embedded.roles.bob = app-user
    Copy to Clipboard Toggle word wrap

  • Role-based access control enfoced via @RolesAllowed annotation:

BasicAuthHelloServiceImpl.java

package io.quarkiverse.cxf.it.auth.basic;

import jakarta.annotation.security.RolesAllowed;
import jakarta.jws.WebService;

import io.quarkiverse.cxf.it.HelloService;

@WebService(serviceName = "HelloService", targetNamespace = HelloService.NS)
@RolesAllowed("app-user")
public class BasicAuthHelloServiceImpl implements HelloService {
    @Override
    public String hello(String person) {
        return "Hello " + person + "!";
    }
}
Copy to Clipboard Toggle word wrap

You can enforce authentication through WS-SecurityPolicy, instead of Mutual TLS and Basic HTTP authentication for clients and services.

To enforce authentication through WS-SecurityPolicy, follow these steps:

  1. Add a supporting tokens policy to an endpoint in the WSDL contract.
  2. On the server side, implement an authentication callback handler and associate it with the endpoint in application.properties or via environment variables. Credentials received from clients are authenticated by the callback handler.
  3. On the client side, provide credentials through either configuration in application.properties or environment variables. Alternatively, you can implement an authentication callback handler to pass the credentials.
6.1.3.1. Specifying an Authentication Policy

If you want to enforce authentication on a service endpoint, associate a supporting tokens policy assertion with the relevant endpoint binding and specify one or more token assertions under it.

There are several different kinds of supporting tokens policy assertions, whose XML element names all end with SupportingTokens (for example, SupportingTokens, SignedSupportingTokens, and so on). For a complete list, see the Supporting Tokens section of the WS-SecurityPolicy specification.

6.1.3.2. UsernameToken policy assertion example
Tip

The sample code snippets used in this section come from the WS-SecurityPolicy integration test in the source tree of Quarkus CXF. You may want to use it as a runnable example.

The following listing shows an example of a policy that requires a WS-Security UsernameToken (which contains username/password credentials) to be included in the security header.

username-token-policy.xml

<?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy
        wsp:Id="UsernameTokenSecurityServicePolicy"
        xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
    xmlns:sp13="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <wsp:ExactlyOne>
        <wsp:All>
            <sp:SupportingTokens>
                <wsp:Policy>
                    <sp:UsernameToken
                        sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
                        <wsp:Policy>
                            <sp:WssUsernameToken11 />
                            <sp13:Created />
                            <sp13:Nonce />
                        </wsp:Policy>
                    </sp:UsernameToken>
                </wsp:Policy>
            </sp:SupportingTokens>
        </wsp:All>
    </wsp:ExactlyOne>
</wsp:Policy>
Copy to Clipboard Toggle word wrap

There are two ways how you can associate this policy file with a service endpoint:

  • Reference the policy on the Service Endpoint Interface (SEI) like this:

    UsernameTokenPolicyHelloService.java

    @WebService(serviceName = "UsernameTokenPolicyHelloService")
    @Policy(placement = Policy.Placement.BINDING, uri = "username-token-policy.xml")
    public interface UsernameTokenPolicyHelloService extends AbstractHelloService {
        ...
    }
    Copy to Clipboard Toggle word wrap

  • Include the policy in your WSDL contract and reference it via PolicyReference element.

When you have the policy in place, configure the credentials on the service endpoint and the client:

application.properties

# A service with a UsernameToken policy assertion
quarkus.cxf.endpoint."/helloUsernameToken".implementor = io.quarkiverse.cxf.it.security.policy.UsernameTokenPolicyHelloServiceImpl
quarkus.cxf.endpoint."/helloUsernameToken".security.callback-handler = #usernameTokenPasswordCallback

# These properties are used in UsernameTokenPasswordCallback
# and in the configuration of the helloUsernameToken below
wss.user = cxf-user
wss.password = secret

# A client with a UsernameToken policy assertion
quarkus.cxf.client.helloUsernameToken.client-endpoint-url = https://localhost:${quarkus.http.test-ssl-port}/services/helloUsernameToken
quarkus.cxf.client.helloUsernameToken.service-interface = io.quarkiverse.cxf.it.security.policy.UsernameTokenPolicyHelloService
quarkus.cxf.client.helloUsernameToken.security.username = ${wss.user}
quarkus.cxf.client.helloUsernameToken.security.password = ${wss.password}
Copy to Clipboard Toggle word wrap

In the above listing, usernameTokenPasswordCallback is a name of a @jakarta.inject.Named bean implementing javax.security.auth.callback.CallbackHandler. Quarkus CXF will lookup a bean with this name in the CDI container.

Here is an example implementation of the bean:

UsernameTokenPasswordCallback.java

package io.quarkiverse.cxf.it.security.policy;

import java.io.IOException;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Named;

import org.apache.wss4j.common.ext.WSPasswordCallback;
import org.eclipse.microprofile.config.inject.ConfigProperty;

@ApplicationScoped
@Named("usernameTokenPasswordCallback") /* We refer to this bean by this name from application.properties */
public class UsernameTokenPasswordCallback implements CallbackHandler {

    /* These two configuration properties are set in application.properties */
    @ConfigProperty(name = "wss.password")
    String password;
    @ConfigProperty(name = "wss.user")
    String user;

    @Override
    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        if (callbacks.length < 1) {
            throw new IllegalStateException("Expected a " + WSPasswordCallback.class.getName()
                    + " at possition 0 of callbacks. Got array of length " + callbacks.length);
        }
        if (!(callbacks[0] instanceof WSPasswordCallback)) {
            throw new IllegalStateException(
                    "Expected a " + WSPasswordCallback.class.getName() + " at possition 0 of callbacks. Got an instance of "
                            + callbacks[0].getClass().getName() + " at possition 0");
        }
        final WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
        if (user.equals(pc.getIdentifier())) {
            pc.setPassword(password);
        } else {
            throw new IllegalStateException("Unexpected user " + user);
        }
    }

}
Copy to Clipboard Toggle word wrap

To test the whole setup, you can create a simple @QuarkusTest:

UsernameTokenTest.java

package io.quarkiverse.cxf.it.security.policy;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

import io.quarkiverse.cxf.annotation.CXFClient;
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
public class UsernameTokenTest {

    @CXFClient("helloUsernameToken")
    UsernameTokenPolicyHelloService helloUsernameToken;

    @Test
    void helloUsernameToken() {
        Assertions.assertThat(helloUsernameToken.hello("CXF")).isEqualTo("Hello CXF from UsernameToken!");
    }
}
Copy to Clipboard Toggle word wrap

When running the test via mvn test -Dtest=UsernameTokenTest, you should see a SOAP message being logged with a Security header containing Username and Password:

Log output of the UsernameTokenTest

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1">
      <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-bac4f255-147e-42a4-aeec-e0a3f5cd3587">
        <wsse:Username>cxf-user</wsse:Username>
        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">secret</wsse:Password>
        <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">3uX15dZT08jRWFWxyWmfhg==</wsse:Nonce>
        <wsu:Created>2024-10-02T17:32:10.497Z</wsu:Created>
      </wsse:UsernameToken>
    </wsse:Security>
  </soap:Header>
  <soap:Body>
    <ns2:hello xmlns:ns2="http://policy.security.it.cxf.quarkiverse.io/">
      <arg0>CXF</arg0>
    </ns2:hello>
  </soap:Body>
</soap:Envelope>
Copy to Clipboard Toggle word wrap

6.1.3.3. SAML v1 and v2 policy assertion examples

The WS-SecurityPolicy integration test contains also analogous examples with SAML v1 and SAML v2 assertions.

Chapter 7. Camel Security

This chapter provides information about Camel route security options.

7.1. Camel security overview

Camel offers several forms & levels of security capabilities that can be utilized on Camel routes. These various forms of security may be used in conjunction with each other or separately.

The broad categories offered are:

  • Route Security - Authentication and Authorization services to proceed on a route or route segment
  • Payload Security - Data Formats that offer encryption/decryption services at the payload level
  • Endpoint Security - Security offered by components that can be utilized by endpointUri associated with the component
  • Configuration Security - Security offered by encrypting sensitive information from configuration files or external Secured Vault systems.

Camel offers the JSSE Utility for configuring SSL/TLS related aspects of a number of Camel components.

7.2. Route Security

Authentication and Authorization Services

Camel offers Route Policy driven security capabilities that may be wired into routes or route segments. A route policy in Camel utilizes a strategy pattern for applying interceptors on Camel Processors. It’s offering the ability to apply cross-cutting concerns (for example. security, transactions etc) of a Camel route.

7.3. Payload Security

Camel offers encryption/decryption services to secure payloads or selectively apply encryption/decryption capabilities on portions/sections of a payload.

The dataformats offering encryption/decryption of payloads utilizing Marshal are:

7.4. Endpoint Security

Some components in Camel offer an ability to secure their endpoints (using interceptors etc) and therefore ensure that they offer the ability to secure payloads as well as provide authentication/authorization capabilities at endpoints created using the components.

7.5. Configuration Security

Camel offers the Properties component to externalize configuration values to properties files. Those values could contain sensitive information such as usernames and passwords.

Those values can be encrypted and automatic decrypted by Camel using:

Camel also support accessing the secured configuration from an external vault systems.

7.5.1. Configuration Security using Vaults

The following Vaults are supported by Camel:

7.5.1.1. Using AWS Vault

To use AWS Secrets Manager you need to provide accessKey, secretKey and the region. This can be done using environmental variables before starting the application:

export $CAMEL_VAULT_AWS_ACCESS_KEY=accessKey
export $CAMEL_VAULT_AWS_SECRET_KEY=secretKey
export $CAMEL_VAULT_AWS_REGION=region
Copy to Clipboard Toggle word wrap

You can also configure the credentials in the application.properties file such as:

camel.vault.aws.accessKey = accessKey
camel.vault.aws.secretKey = secretKey
camel.vault.aws.region = region
Copy to Clipboard Toggle word wrap

If you want instead to use the AWS default credentials provider, you’ll need to provide the following env variables:

export $CAMEL_VAULT_AWS_USE_DEFAULT_CREDENTIALS_PROVIDER=true
export $CAMEL_VAULT_AWS_REGION=region
Copy to Clipboard Toggle word wrap

You can also configure the credentials in the application.properties file such as:

camel.vault.aws.defaultCredentialsProvider = true
camel.vault.aws.region = region
Copy to Clipboard Toggle word wrap

It is also possible to specify a particular profile name for accessing AWS Secrets Manager

export $CAMEL_VAULT_AWS_USE_PROFILE_CREDENTIALS_PROVIDER=true
export $CAMEL_VAULT_AWS_PROFILE_NAME=test-account
export $CAMEL_VAULT_AWS_REGION=region
Copy to Clipboard Toggle word wrap

You can also configure the credentials in the application.properties file such as:

camel.vault.aws.profileCredentialsProvider = true
camel.vault.aws.profileName = test-account
camel.vault.aws.region = region
Copy to Clipboard Toggle word wrap

At this point you’ll be able to reference a property in the following way by using aws: as prefix in the {{ }} syntax:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{aws:route}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

Where route will be the name of the secret stored in the AWS Secrets Manager Service.

You could specify a default value in case the secret is not present on AWS Secret Manager:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{aws:route:default}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

In this case if the secret doesn’t exist, the property will fallback to "default" as value.

Also, you are able to get particular field of the secret, if you have for example a secret named database of this form:

{
  "username": "admin",
  "password": "password123",
  "engine": "postgres",
  "host": "127.0.0.1",
  "port": "3128",
  "dbname": "db"
}
Copy to Clipboard Toggle word wrap

You’re able to do get single secret value in your route, like for example:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Username is {{aws:database/username}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

Or re-use the property as part of an endpoint.

You could specify a default value in case the particular field of secret is not present on AWS Secret Manager:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Username is {{aws:database/username:admin}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

In this case if the secret doesn’t exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value.

Note

For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done.

The only requirement is adding camel-aws-secrets-manager JAR to your Camel application.

7.5.1.2. Using Google Secret Manager GCP Vault

To use GCP Secret Manager you need to provide serviceAccountKey file and GCP projectId. This can be done using environmental variables before starting the application:

export $CAMEL_VAULT_GCP_SERVICE_ACCOUNT_KEY=file:////path/to/service.accountkey
export $CAMEL_VAULT_GCP_PROJECT_ID=projectId
Copy to Clipboard Toggle word wrap

You can also configure the credentials in the application.properties file such as:

camel.vault.gcp.serviceAccountKey = accessKey
camel.vault.gcp.projectId = secretKey
Copy to Clipboard Toggle word wrap

If you want instead to use the GCP default client instance, you’ll need to provide the following env variables:

export $CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE=true
export $CAMEL_VAULT_GCP_PROJECT_ID=projectId
Copy to Clipboard Toggle word wrap

You can also configure the credentials in the application.properties file such as:

camel.vault.gcp.useDefaultInstance = true
camel.vault.aws.projectId = region
Copy to Clipboard Toggle word wrap

At this point you’ll be able to reference a property in the following way by using gcp: as prefix in the {{ }} syntax:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{gcp:route}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

Where route will be the name of the secret stored in the GCP Secret Manager Service.

You could specify a default value in case the secret is not present on GCP Secret Manager:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{gcp:route:default}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

In this case if the secret doesn’t exist, the property will fallback to "default" as value.

Also, you are able to get particular field of the secret, if you have for example a secret named database of this form:

{
  "username": "admin",
  "password": "password123",
  "engine": "postgres",
  "host": "127.0.0.1",
  "port": "3128",
  "dbname": "db"
}
Copy to Clipboard Toggle word wrap

You’re able to do get single secret value in your route, like for example:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Username is {{gcp:database/username}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

Or re-use the property as part of an endpoint.

You could specify a default value in case the particular field of secret is not present on GCP Secret Manager:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Username is {{gcp:database/username:admin}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

In this case if the secret doesn’t exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value.

Note

For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done.

There are only two requirements: - Adding camel-google-secret-manager JAR to your Camel application. - Give the service account used permissions to do operation at secret management level (for example accessing the secret payload, or being admin of secret manager service)

7.5.1.3. Using Azure Key Vault

To use this function you’ll need to provide credentials to Azure Key Vault Service as environment variables:

export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId
export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId
export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret
export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
Copy to Clipboard Toggle word wrap

You can also configure the credentials in the application.properties file such as:

camel.vault.azure.tenantId = accessKey
camel.vault.azure.clientId = clientId
camel.vault.azure.clientSecret = clientSecret
camel.vault.azure.vaultName = vaultName
Copy to Clipboard Toggle word wrap

Or you can enable the usage of Azure Identity in the following way:

export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
Copy to Clipboard Toggle word wrap

You can also enable the usage of Azure Identity in the application.properties file such as:

camel.vault.azure.azureIdentityEnabled = true
camel.vault.azure.vaultName = vaultName
Copy to Clipboard Toggle word wrap

At this point you’ll be able to reference a property in the following way:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{azure:route}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

Where route will be the name of the secret stored in the Azure Key Vault Service.

You could specify a default value in case the secret is not present on Azure Key Vault Service:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{azure:route:default}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

In this case if the secret doesn’t exist, the property will fallback to "default" as value.

Also you are able to get particular field of the secret, if you have for example a secret named database of this form:

{
  "username": "admin",
  "password": "password123",
  "engine": "postgres",
  "host": "127.0.0.1",
  "port": "3128",
  "dbname": "db"
}
Copy to Clipboard Toggle word wrap

You’re able to do get single secret value in your route, like for example:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Username is {{azure:database/username}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

Or re-use the property as part of an endpoint.

You could specify a default value in case the particular field of secret is not present on Azure Key Vault:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Username is {{azure:database/username:admin}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

In this case if the secret doesn’t exist or the secret exists, but the username field is not part of the secret, the property will fallback to "admin" as value.

For the moment we are not considering the rotation function, if any will be applied, but it is in the work to be done.

The only requirement is adding the camel-azure-key-vault jar to your Camel application.

7.5.1.4. Using Hashicorp Vault

To use this function, you’ll need to provide credentials for Hashicorp vault as environment variables:

export $CAMEL_VAULT_HASHICORP_TOKEN=token
export $CAMEL_VAULT_HASHICORP_HOST=host
export $CAMEL_VAULT_HASHICORP_PORT=port
export $CAMEL_VAULT_HASHICORP_SCHEME=http/https
Copy to Clipboard Toggle word wrap

You can also configure the credentials in the application.properties file such as:

camel.vault.hashicorp.token = token
camel.vault.hashicorp.host = host
camel.vault.hashicorp.port = port
camel.vault.hashicorp.scheme = scheme
Copy to Clipboard Toggle word wrap

At this point, you’ll be able to reference a property in the following way:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{hashicorp:secret:route}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

Where route will be the name of the secret stored in the Hashicorp Vault instance, in the 'secret' engine.

You could specify a default value in case the secret is not present on Hashicorp Vault instance:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{hashicorp:secret:route:default}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

In this case, if the secret doesn’t exist in the 'secret' engine, the property will fall back to "default" as value.

Also, you are able to get a particular field of the secret, if you have, for example, a secret named database of this form:

{
  "username": "admin",
  "password": "password123",
  "engine": "postgres",
  "host": "127.0.0.1",
  "port": "3128",
  "dbname": "db"
}
Copy to Clipboard Toggle word wrap

You’re able to do get single secret value in your route, in the 'secret' engine, like for example:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Username is {{hashicorp:secret:database/username}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

Or re-use the property as part of an endpoint.

You could specify a default value in case the particular field of secret is not present on Hashicorp Vault instance, in the 'secret' engine:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Username is {{hashicorp:secret:database/username:admin}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

In this case, if the secret doesn’t exist or the secret exists (in the 'secret' engine) but the username field is not part of the secret, the property will fall back to "admin" as value.

There is also the syntax to get a particular version of the secret for both the approach, with field/default value specified or only with secret:

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{hashicorp:secret:route@2}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

This approach will return the RAW route secret with version '2', in the 'secret' engine.

<camelContext>
    <route>
        <from uri="direct:start"/>
        <to uri="{{hashicorp:route:default@2}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

This approach will return the route secret value with version '2' or default value in case the secret doesn’t exist or the version doesn’t exist (in the 'secret' engine).

<camelContext>
    <route>
        <from uri="direct:start"/>
        <log message="Username is {{hashicorp:secret:database/username:admin@2}}"/>
    </route>
</camelContext>
Copy to Clipboard Toggle word wrap

This approach will return the username field of the database secret with version '2' or admin in case the secret doesn’t exist or the version doesn’t exist (in the 'secret' engine).

Being able to reload Camel context on a Secret Refresh, could be done by specifying the usual credentials (the same used for AWS Secret Manager Property Function).

With Environment variables:

export $CAMEL_VAULT_AWS_USE_DEFAULT_CREDENTIALS_PROVIDER=accessKey
export $CAMEL_VAULT_AWS_REGION=region
Copy to Clipboard Toggle word wrap

or as plain Camel main properties:

camel.vault.aws.useDefaultCredentialProvider = true
camel.vault.aws.region = region
Copy to Clipboard Toggle word wrap

Or by specifying accessKey/SecretKey and region, instead of using the default credentials provider chain.

To enable the automatic refresh you’ll need additional properties to set:

camel.vault.aws.refreshEnabled=true
camel.vault.aws.refreshPeriod=60000
camel.vault.aws.secrets=Secret
camel.main.context-reload-enabled = true
Copy to Clipboard Toggle word wrap

where camel.vault.aws.refreshEnabled will enable the automatic context reload, camel.vault.aws.refreshPeriod is the interval of time between two different checks for update events and camel.vault.aws.secrets is a regex representing the secrets we want to track for updates.

Note that camel.vault.aws.secrets is not mandatory: if not specified the task responsible for checking updates events will take into accounts or the properties with an aws: prefix.

The only requirement is adding the camel-aws-secrets-manager jar to your Camel application.

Another option is to use AWS EventBridge in conjunction with the AWS SQS service.

On the AWS side, the following resources need to be created:

  • an AWS Couldtrail trail
  • an AWS SQS Queue
  • an Eventbridge rule of the following kind
{
  "source": ["aws.secretsmanager"],
  "detail-type": ["AWS API Call via CloudTrail"],
  "detail": {
    "eventSource": ["secretsmanager.amazonaws.com"]
  }
}
Copy to Clipboard Toggle word wrap

This rule will make the event related to AWS Secrets Manager filtered

  • You need to set the a Rule target to the AWS SQS Queue for Eventbridge rule
  • You need to give permission to the Eventbrige rule, to write on the above SQS Queue. For doing this you’ll need to define a json file like this:
{
    "Policy": "{\"Version\":\"2012-10-17\",\"Id\":\"<queue_arn>/SQSDefaultPolicy\",\"Statement\":[{\"Sid\": \"EventsToMyQueue\", \"Effect\": \"Allow\", \"Principal\": {\"Service\": \"events.amazonaws.com\"}, \"Action\": \"sqs:SendMessage\", \"Resource\": \"<queue_arn>\", \"Condition\": {\"ArnEquals\": {\"aws:SourceArn\": \"<eventbridge_rule_arn>\"}}}]}"
}
Copy to Clipboard Toggle word wrap

Change the values for queue_arn and eventbridge_rule_arn, save the file with policy.json name and run the following command with AWS CLI

aws sqs set-queue-attributes --queue-url <queue_url> --attributes file://policy.json
Copy to Clipboard Toggle word wrap

where queue_url is the AWS SQS Queue URL of the just created Queue.

Now you should be able to set up the configuration on the Camel side. To enable the SQS notification add the following properties:

camel.vault.aws.refreshEnabled=true
camel.vault.aws.refreshPeriod=60000
camel.vault.aws.secrets=Secret
camel.main.context-reload-enabled = true
camel.vault.aws.useSqsNotification=true
camel.vault.aws.sqsQueueUrl=<queue_url>
Copy to Clipboard Toggle word wrap

where queue_url is the AWS SQS Queue URL of the just created Queue.

Whenever an event of PutSecretValue for the Secret named 'Secret' will happen, a message will be enqueued in the AWS SQS Queue and consumed on the Camel side and a context reload will be triggered.

Being able to reload Camel context on a Secret Refresh, could be done by specifying the usual credentials (the same used for Google Secret Manager Property Function).

With Environment variables:

export $CAMEL_VAULT_GCP_USE_DEFAULT_INSTANCE=true
export $CAMEL_VAULT_GCP_PROJECT_ID=projectId
Copy to Clipboard Toggle word wrap

or as plain Camel main properties:

camel.vault.gcp.useDefaultInstance = true
camel.vault.aws.projectId = projectId
Copy to Clipboard Toggle word wrap

Or by specifying a path to a service account key file, instead of using the default instance.

To enable the automatic refresh you’ll need additional properties to set:

camel.vault.gcp.projectId= projectId
camel.vault.gcp.refreshEnabled=true
camel.vault.gcp.refreshPeriod=60000
camel.vault.gcp.secrets=hello*
camel.vault.gcp.subscriptionName=subscriptionName
camel.main.context-reload-enabled = true
Copy to Clipboard Toggle word wrap

where camel.vault.gcp.refreshEnabled will enable the automatic context reload, camel.vault.gcp.refreshPeriod is the interval of time between two different checks for update events and camel.vault.gcp.secrets is a regex representing the secrets we want to track for updates.

Note that camel.vault.gcp.secrets is not mandatory: if not specified the task responsible for checking updates events will take into accounts or the properties with an gcp: prefix.

The camel.vault.gcp.subscriptionName is the subscription name created in relation to the Google PubSub topic associated with the tracked secrets.

This mechanism while make use of the notification system related to Google Secret Manager: through this feature, every secret could be associated to one up to ten Google Pubsub Topics. These topics will receive events related to life cycle of the secret.

There are only two requirements: - Adding camel-google-secret-manager JAR to your Camel application. - Give the service account used permissions to do operation at secret management level (for example accessing the secret payload, or being admin of secret manager service and also have permission over the Pubsub service)

Being able to reload Camel context on a Secret Refresh, could be done by specifying the usual credentials (the same used for Azure Key Vault Property Function).

With Environment variables:

export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId
export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId
export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret
export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
Copy to Clipboard Toggle word wrap

or as plain Camel main properties:

camel.vault.azure.tenantId = accessKey
camel.vault.azure.clientId = clientId
camel.vault.azure.clientSecret = clientSecret
camel.vault.azure.vaultName = vaultName
Copy to Clipboard Toggle word wrap

If you want to use Azure Identity with environment variables, you can do in the following way:

export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
Copy to Clipboard Toggle word wrap

You can also enable the usage of Azure Identity in the application.properties file such as:

camel.vault.azure.azureIdentityEnabled = true
camel.vault.azure.vaultName = vaultName
Copy to Clipboard Toggle word wrap

To enable the automatic refresh you’ll need additional properties to set:

camel.vault.azure.refreshEnabled=true
camel.vault.azure.refreshPeriod=60000
camel.vault.azure.secrets=Secret
camel.vault.azure.eventhubConnectionString=eventhub_conn_string
camel.vault.azure.blobAccountName=blob_account_name
camel.vault.azure.blobContainerName=blob_container_name
camel.vault.azure.blobAccessKey=blob_access_key
camel.main.context-reload-enabled = true
Copy to Clipboard Toggle word wrap

where camel.vault.azure.refreshEnabled will enable the automatic context reload, camel.vault.azure.refreshPeriod is the interval of time between two different checks for update events and camel.vault.azure.secrets is a regex representing the secrets we want to track for updates.

where camel.vault.azure.eventhubConnectionString is the eventhub connection string to get notification from, camel.vault.azure.blobAccountName, camel.vault.azure.blobContainerName and camel.vault.azure.blobAccessKey are the Azure Storage Blob parameters for the checkpoint store needed by Azure Eventhub.

Note that camel.vault.azure.secrets is not mandatory: if not specified the task responsible for checking updates events will take into accounts or the properties with an azure: prefix.

The only requirement is adding the camel-azure-key-vault jar to your Camel application.

Chapter 8. Camel Quarkus transaction guide

8.1. About the transaction guide

This guide provides information and instructions for implementing transactional applications with Red Hat build of Apache Camel for Quarkus.

8.2. JTA dependencies

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>
Copy to Clipboard Toggle word wrap

This leverages quarkus-narayana-jta to provide JTA support in Camel.

8.2.1. Important configurations

There are some important quarkus.transaction-manager configurations you need to be aware of:

Expand
ConfigurationDefault valueDescriptionComment

.node-name

quarkus

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.

.object-store.type

file-system

Configures where the transaction logs are stored - either in a directory (file-system) or in a database (jdbc).

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

.enable-recovery

false

Enables recovery of pending transactions in case of a JVM crash or shutdown.

We recommend that you set it to true when you are using XA transactions in your application. Otherwise, pending transactions are lost in case of a JVM crash or shutdown.

8.3. Configuring transactional resources

8.3.1. JDBC Datasource configuration

To configure the datasource:

  1. 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

  1. If you want to use the datasource in a XA transaction, you must enable it:

    quarkus.datasource.jdbc.transactions = xa

    quarkus.datasource.<datasource-name>.jdbc.transactions = xa

    For more information, refer to the Narayana transaction manager integration section in the Quarkus datasource guide.

Warning

Do not mix using non-XA and XA datasource in a transaction.

It is not a transaction safe.

8.3.2. JMS Configuration

In order to use JMS with distributed transactions, you must do the following:

  1. Use quarkus-pooled-jms to support pooling and transaction, by including the following dependency in your pom.xml:

    <dependency>
        <groupId>io.quarkiverse.messaginghub</groupId>
        <artifactId>quarkus-pooled-jms</artifactId>
    </dependency>
    Copy to Clipboard Toggle word wrap
  2. Enable XA support by setting .transaction to xa:

    quarkus.pooled-jms.transaction = xa

For more details, see Support for connection pooling and X/Open XA distributed transactions in the JMS extension documentation.

8.4. Examples

JPA and JMS

We use Narayana as the standalone JTA Transaction Manager implementation, and Hibernate as the JPA Adapter.

JMS and JPA: A Camel Quarkus example

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.

Message Bridge: A Camel Quarkus example

8.5. Transaction policies

There are six transaction policies:

Expand
PolicyDescriptionComment

PROPAGATION_MANDATORY

Support a current transaction; throw an exception if no current transaction exists.

 

PROPAGATION_NEVER

Do not support a current transaction; throw an exception if a current transaction exists.

 

PROPAGATION_NOT_SUPPORTED

Do not support a current transaction; rather always execute non-transactionally.

 

PROPAGATION_REQUIRED

Support a current transaction; create a new one if none exists.

Default

PROPAGATION_REQUIRES_NEW

Create a new transaction, suspending the current transaction if one exists.

 

PROPAGATION_SUPPORTS

Support a current transaction; execute non-transactionally if none exists.

 

For more details, see Using different transaction propagations in the Quarkus Transactional client documentation.

8.6. Known issues

8.6.1. Non-XA datasource compatibility

Since 3.8.4, there is a compatibility break issue when using non-XA datasource. For more information see the pull request 40365

Legal Notice

Copyright © Red Hat.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top