【发布时间】:2020-11-11 11:58:56
【问题描述】:
我们最近将我们的一个项目从 camel 2.25.2 更新到了 3.4.0。
有一个名为 CompositeRegistry 的类,但 Camel 文档说它已被弃用或在新版本中不可用。
所以我们使用了DefaultRegistry 类,它没有addRegistry 方法。
我们的旧代码使用CompositeRegistry 类及其方法。我该如何解决这个问题?
旧代码:
private void registerSoapEndpoint() {
SimpleRegistry simpleRegistry = new SimpleRegistry();
CxfEndpoint cxfEndpoint = new SoapEndpoint().getCxfEndpoint();
simpleRegistry.put("TrobuleTicketEndpoint", cxfEndpoint);
CamelContext camelctx = getContext();
CompositeRegistry compositeRegistryTest = new CompositeRegistry();
compositeRegistryTest.addRegistry(camelctx.getRegistry());
compositeRegistryTest.addRegistry(simpleRegistry);
((DefaultCamelContext) camelctx).setRegistry(compositeRegistryTest);
}
【问题讨论】:
-
我建议您阅读迁移指南,例如 Apache Camel 2.x to 3.0 Migration Guide,您的具体问题已在 here 中介绍过),也可能适用于 Apache Camel 3.x Upgrade Guide 中列出的中间 3.x 版本.
标签: java apache-camel