CXF-RS

CXF-RS

Scheme: cxfrs
Syntax: cxfrs:beanId:address
Description: Defines the CXF RS Component
Maven: org.apache.camel/camel-cxf/2.16.2

The cxfrs component is used for JAX-RS REST services using Apache CXF.

Name Kind Group Required Default Type Enum Description
bus path common org.apache.cxf.Bus To use a custom configured CXF Bus.
beanId path common java.lang.String To lookup an existing configured CxfRsEndpoint. Must used bean: as prefix.
address path common java.lang.String The service publish address.
binding parameter common org.apache.camel.component.cxf.jaxrs.CxfRsBinding To use a custom CxfBinding to control the binding between Camel Message and CXF Message.
bindingStyle parameter common Default org.apache.camel.component.cxf.jaxrs.BindingStyle SimpleConsumer
Default
Custom
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 {@link 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 {@link 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.
continuationTimeout parameter common 30000 long 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.
defaultBus parameter common boolean Will set the default bus when CXF endpoint create a bus by itself
features parameter common java.util.List Set the feature list to the CxfRs endpoint.
headerFilterStrategy parameter common org.apache.camel.spi.HeaderFilterStrategy To use a custom HeaderFilterStrategy to filter header to and from Camel message.
httpClientAPI parameter common true boolean 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 parameter common boolean This option is used to tell CxfRsProducer to ignore the message body of the DELETE method when using HTTP API.
loggingFeatureEnabled parameter common boolean This option enables CXF Logging Feature which writes inbound and outbound REST messages to log.
loggingSizeLimit parameter common int To limit the total size of number of bytes the logger will output when logging feature has been enabled.
maxClientCacheSize parameter common 10 int This option allows you to configure the maximum size of the cache. The implementation caches CXF clients or ClientFactoryBean in CxfProvider and CxfRsProvider.
modelRef parameter common java.lang.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
performInvocation parameter common boolean 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 parameter common boolean 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.
providers parameter common java.util.List Set custom JAX-RS provider(s) list to the CxfRs endpoint.
resourceClasses parameter common java.util.List> The resource classes which you want to export as REST service. Multiple classes can be separated by comma.
schemaLocations parameter common java.util.List Sets the locations of the schema(s) which can be used to validate the incoming XML or JAXB-driven JSON.
skipFaultLogging parameter common boolean This option controls whether the PhaseInterceptorChain skips logging the Fault that it catches.
throwExceptionOnFailure parameter common true boolean This option tells the CxfRsProducer to inspect return codes and will generate an Exception if the return code is larger than 207.
bridgeErrorHandler parameter consumer boolean Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN/ERROR level and ignored.
exceptionHandler parameter consumer (advanced) org.apache.camel.spi.ExceptionHandler To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored.
exchangePattern parameter advanced InOnly org.apache.camel.ExchangePattern InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the default exchange pattern when creating an exchange
synchronous parameter advanced false boolean Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).

cxfrs consumer

A Consumer of exchanges for a JAXRS service in CXF. CxfRsConsumer acts a CXF service to receive REST requests, convert them to a normal java object invocation, and forward them to Camel route for processing. It is also responsible for converting and sending back responses to CXF client.