209.4.2. 部署 KuraRouter
包含 Kura router 类的捆绑包应该在 OSGi 清单中导入以下软件包:
Import-Package: org.osgi.framework;version="1.3.0", org.slf4j;version="1.6.4", org.apache.camel,org.apache.camel.impl,org.apache.camel.core.osgi,org.apache.camel.builder,org.apache.camel.model, org.apache.camel.component.kura
请记住,您不必导入每个计划在路由中使用的 Camel 组件捆绑包,因为 Camel 组件作为运行时级别的服务来解决。
在部署路由器捆绑包前,请确定您已部署(并启动)以下 Camel 核心捆绑包(使用 Kura GoGo shell)…
install file:///home/user/.m2/repository/org/apache/camel/camel-core/2.15.0/camel-core-2.15.0.jar start <camel-core-bundle-id> install file:///home/user/.m2/repository/org/apache/camel/camel-core-osgi/2.15.0/camel-core-osgi-2.15.0.jar start <camel-core-osgi-bundle-id> install file:///home/user/.m2/repository/org/apache/camel/camel-kura/2.15.0/camel-kura-2.15.0.jar start <camel-kura-bundle-id>
…and 所有计划在路由中使用的组件:
install file:///home/user/.m2/repository/org/apache/camel/camel-stream/2.15.0/camel-stream-2.15.0.jar start <camel-stream-bundle-id>
然后最终部署您的路由器捆绑包:
install file:///home/user/.m2/repository/com/example/myrouter/1.0/myrouter-1.0.jar start <your-bundle-id>