如何在骆驼上下文中删除所有路线定义...类似
context.removeRouteDefinitions(context.getRouteDefinitions());
答案 0 :(得分:1)
context.removeRouteDefinitions(new ArrayList(context.getRouteDefinitions()));
答案 1 :(得分:0)
请尝试通过您的路线将此方法称为bean方法:
public void removeRoutes(Exchange exchange) {
new Thread(() -> {
try {
exchange.getContext().stopRoute("currentRoute");
exchange.getContext().removeRouteDefinitions(context.getRouteDefinitions());
} catch (Exception e) {
e.printStackTrace();
}
}).start();
}