我將camel-parent 從2.x 升級到3.x。我在代碼中使用過:
exchange.getContext()
.getRoute(exchange.getFromRouteId())
.getRouteContext()
.getRoute()
.stop();
現在
exchange.getContext()
.getRoute(exchange.getFromRouteId())
.getRouteContext()
為我們提供了一個我們無法訪問的介面,org.apache.camel.model.RouteDefinition而不是我們
org.apache.camel.NamedNode無法執行的stop方法。你能告訴我我怎樣才能到達這個 RouteDefinition 以便我可以stop在它上面執行方法嗎?
uj5u.com熱心網友回復:
這樣做的新方法(在 Camel 3 中)是使用RouteController,例如:
camelContext.getRouteController().suspendRoute("my-route-id");
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/369943.html
