我正在尝试使用蓝图、apache camel 和 apache cxf-rs 开发一个休息服务——服务实现将由骆驼处理。
问题是其余端点似乎没有分配给骆驼。
这是我得到的例外:
启动 Camel 时发生错误:CamelContext(blueprintContext) 由于 /crm 上已经有一个端点正在运行。
我的蓝图如下:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
xmlns:cxf="http://cxf.apache.org/blueprint/core"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd
http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<jaxrs:server id="customerService" address="/crm" staticSubresourceResolution="true">
<jaxrs:serviceBeans>
<ref component-id="customerSvc"/>
</jaxrs:serviceBeans>
<jaxrs:features>
<bean class="io.fabric8.cxf.endpoint.SwaggerFeature"/>
<bean class="io.fabric8.cxf.endpoint.ManagedApiFeature"/>
</jaxrs:features>
<jaxrs:providers>
<bean class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
</jaxrs:providers>
</jaxrs:server>
<bean id="customerSvc" class="restfuse.CustomerService"/>
<cxf:bus>
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
<camelContext id="blueprintContext" trace="false" xmlns="http://camel.apache.org/schema/blueprint">
<route customId="true" id="timerToLog">
<from uri="cxfrs:bean:customerService"/>
<setBody>
<method ref="helloBean" method="hello"></method>
</setBody>
<log message="The message contains ${body}"/>
<to uri="mock:result"/>
</route>