我正在使用apache cxf和camel创建restful webservices。我的配置是这样的:
<camelcxf:rsServer id="applicationserver" address="/" staticSubresourceResolution="true">
<camelcxf:serviceBeans>
<ref bean="Demo" />
<ref bean="Foo" />
<ref bean="Bar" />
</camelcxf:serviceBeans>
</camelcxf:rsServer>
我有三个服务bean作为服务公开,并映射到不同的URL,路由是这样的:
<camel:route id="ServerRoute">
<camel:from uri="cxfrs://bean://applicationserver" />
<camel:process ref="camelCxfInProcessor" />
<camel:to uri="http://google" />
<camel:to uri="bean:googlereqreshandler" />
现在对于每个服务bean我想要有不同的路由,因为这三个都有不同的功能,但是我无法确定我应该在我的
中写什么<from: uri="cxfrs://bean://aplicationserver..."/>
标记以根据服务bean区分路由。或者还有其他方法吗?请提出建议。
答案 0 :(得分:0)
你看过Camel CXFRS documentation了吗?他们在示例中采用的方法是使一条路线充当“全部捕获”,然后根据以下值执行不同的操作:
String operationName = exchange.getIn()
.getHeader(CxfConstants.OPERATION_NAME, String.class);