295.5.2. 使用 Camel SCR 捆绑包作为模板

假设您有一个实现您经常使用的集成模式的 Camel SCR 捆绑包,即: 从 → 到,成功/失败日志记录,并重新传送(同样是我们的示例路由实施模式)。您可能不希望为每个实例创建单独的捆绑包。没有覆盖的 SCR。

为您的 Service 组件创建一个配置 PID,但添加一个带有短划线和 SCR 的尾部,将使用该配置来创建组件的新实例。

创建新的服务组件实例

# Create a PID with a tail
karaf@root> config:edit example.CamelScrExample-anotherone
 
# Override some properties
karaf@root> config:propset camelContextId my-other-context
karaf@root> config:propset to "file://removeme?fileName=removemetoo.txt"
 
# Save the PID
karaf@root> config:update

这将使用您覆盖的属性启动新的 CamelContext。如何方便.