CXF REST — provides integration for linking with JAX-RS based RESTful services
CXF REST endpoints support two URI formats:
cxfrs://address
?options
Where address
represents the CXF endpoint's address
cxfrs:bean:rsEndpoint
Where rsEndpoint
represents the Spring bean's name which
represents the CXFRS client or server
Maven users will need to add a dependency on camel-cxf
to their poms as
shown in Example 3, “Apache CXF dependency”.
Example 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.
Table 5, “CXF REST options” lists the options for a CXF REST endpoint.
Table 5. 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.