2014-09-19 91 views

回答

1

您可以使用Java DSL(領域特定語言)做cxfrs的大部分配置。一個例子(在RouteBuilder#配置方法):

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

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

駱駝版本2.16.2(行家:org.apache.camel:駱駝CXF傳輸:2.16.2)CXF版本是3.1.4( org.apache.cxf:cxf-rt-transports-http-jetty:3.1.4)

+0

我還沒有找到任何關於此的文檔,我只是尋找「CxfRsCompoent」和「CxfRsEndpoint」並進行了實驗 – 2016-03-12 13:25:16

0

很難在不使用Spring的情況下配置cxfrs端點上的所有東西。 但是你可以通過使用URI選項,如

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