2 Home
gitea_admin edited this page 2026-03-11 14:37:02 +00:00

CXF-RS

Expose JAX-RS REST services using Apache CXF or connect to external REST services using CXF REST client.

Metadata

Property Value
Scheme cxfrs
Support Level Stable
Labels rest
Version 4.10.2

Maven Dependency

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-cxf-rest</artifactId>
    <version>4.10.2</version>
</dependency>

Endpoint Properties

Name Type Required Default Description
beanId string To lookup an existing configured CxfRsEndpoint. Must used bean: as prefix.
address string The service publish address.
features array Set the feature list to the CxfRs endpoint.
modelRef string This option is used to specify the model file which is useful for the resource class without annotation. When using this option, then the service class can be omitted, to emulate document-only endpoints
providers string Set custom JAX-RS provider(s) list to the CxfRs endpoint. You can specify a string with a list of providers to lookup in the registy separated by comma.
resourceClasses array The resource classes which you want to export as REST service. Multiple classes can be separated by comma.
schemaLocations array Sets the locations of the schema(s) which can be used to validate the incoming XML or JAXB-driven JSON.
skipFaultLogging boolean false This option controls whether the PhaseInterceptorChain skips logging the Fault that it catches.
bindingStyle object Default Sets how requests and responses will be mapped to/from Camel. Two values are possible: SimpleConsumer: This binding style processes request parameters, multiparts, etc. and maps them to IN headers, IN attachments and to the message body. It aims to eliminate low-level processing of org.apache.cxf.message.MessageContentsList. It also also adds more flexibility and simplicity to the response mapping. Only available for consumers. Default: The default style. For consumers this passes on a MessageContentsList to the route, requiring low-level processing in the route. This is the traditional binding style, which simply dumps the org.apache.cxf.message.MessageContentsList coming in from the CXF stack onto the IN message body. The user is then responsible for processing it according to the contract defined by the JAX-RS method signature. Custom: allows you to specify a custom binding through the binding option.
publishedEndpointUrl string This option can override the endpointUrl that published from the WADL which can be accessed with resource address url plus _wadl
bridgeErrorHandler boolean false Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.
exceptionHandler object To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.
exchangePattern object Sets the exchange pattern when the consumer creates an exchange.
serviceBeans string The service beans (the bean ids to lookup in the registry) which you want to export as REST service. Multiple beans can be separated by comma
cookieHandler object Configure a cookie handler to maintain a HTTP session
hostnameVerifier object The hostname verifier to be used. Use the # notation to reference a HostnameVerifier from the registry.
sslContextParameters object The Camel SSL setting reference. Use the # notation to reference the SSL Context.
throwExceptionOnFailure boolean true This option tells the CxfRsProducer to inspect return codes and will generate an Exception if the return code is larger than 207.
httpClientAPI boolean true If it is true, the CxfRsProducer will use the HttpClientAPI to invoke the service. If it is false, the CxfRsProducer will use the ProxyClientAPI to invoke the service
ignoreDeleteMethodMessageBody boolean false This option is used to tell CxfRsProducer to ignore the message body of the DELETE method when using HTTP API.
lazyStartProducer boolean false Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.
maxClientCacheSize integer 10 This option allows you to configure the maximum size of the cache. The implementation caches CXF clients or ClientFactoryBean in CxfProvider and CxfRsProvider.
synchronous boolean false Sets whether synchronous processing should be strictly used
binding object To use a custom CxfBinding to control the binding between Camel Message and CXF Message.
bus object To use a custom configured CXF Bus.
continuationTimeout duration 30000 This option is used to set the CXF continuation timeout which could be used in CxfConsumer by default when the CXF server is using Jetty or Servlet transport.
cxfRsConfigurer object This option could apply the implementation of org.apache.camel.component.cxf.jaxrs.CxfRsEndpointConfigurer which supports to configure the CXF endpoint in programmatic way. User can configure the CXF server and client by implementing configure{Server/Client} method of CxfEndpointConfigurer.
defaultBus boolean false Will set the default bus when CXF endpoint create a bus by itself
headerFilterStrategy object To use a custom HeaderFilterStrategy to filter header to and from Camel message.
performInvocation boolean false When the option is true, Camel will perform the invocation of the resource class instance and put the response object into the exchange for further processing.
propagateContexts boolean false When the option is true, JAXRS UriInfo, HttpHeaders, Request and SecurityContext contexts will be available to custom CXFRS processors as typed Camel exchange properties. These contexts can be used to analyze the current requests using JAX-RS API.
loggingFeatureEnabled boolean false This option enables CXF Logging Feature which writes inbound and outbound REST messages to log.
loggingSizeLimit integer 49152 To limit the total size of number of bytes the logger will output when logging feature has been enabled and -1 for no limit.