Name
CXF REST — provides integration for linking with JAX-RS based RESTful services
URI format
CXF REST endpoints support two URI formats:
cxfrs://
address?optionsWhere
addressrepresents the CXF endpoint's addresscxfrs:bean:
rsEndpointWhere
rsEndpointrepresents the Spring bean's name which represents the CXFRS client or server
Dependencies
Maven users will need to add a dependency on camel-cxf to their poms as
shown in Example 2.3.
Example 2.3. Apache CXF dependency
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency>If you want to learn about Apache CXF dependencies, see the WHICH-JARS text file.
Options
Table 2.4 lists the options for a CXF REST endpoint.
Table 2.4. CXF REST options
| Option | Default Value | Description |
|---|---|---|
resourceClasses | Specifies the resource classes you want to export as REST service. | |
httpClientAPI | true | Specifies if the CxfRsProducer will use the
HttpClientAPI to invoke the service. |
synchronous | false | Specifies if the CxfRsConsumer uses sync or async API
to do the underlying work. |
throwExceptionOnFailure | true | Specifies if the CxfRsProducer inspects return codes and will
generate an exception if the return code is larger than 207. |
You can also configure the CXF REST endpoint through the Spring configuration.








