0
votes

I want to use simple binding provided by cxfrs module of camel without using spring. The example given on the apache website uses spring. http://camel.apache.org/cxfrs.html Can anyone explain how to use simple binding without spring?

2

2 Answers

1
votes

You can use the Java DSL (Domain Specific Language). An example (in a RouteBuilder#configure method):

CxfRsComponent cxfComponent = new CxfRsComponent(context);
CxfRsEndpoint serviceEndpoint = new CxfRsEndpoint("http:/localhost/rest", cxfComponent);
serviceEndpoint.addResourceClass(MyService.class);

from(serviceEndpoint).log("this is irrelevant");

Camel version is 2.16.2 (maven: org.apache.camel:camel-cxf-transport:2.16.2) CXF version is 3.1.4 (org.apache.cxf:cxf-rt-transports-http-jetty:3.1.4)

0
votes

It's hard to configure every thing on the cxfrs endpoint without using Spring. But you can do most configuration of cxfrs by using the uri options such as

from("cxfrs://http://localhost:9000/context/rest?resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerServiceResource&bindingStyle=SimpleConsumer")