在 Apache Camel RouteBuilder 配置中,.id() 和 .routeId() 有什么区别

In Apache Camel RouteBuilder configure, what is the difference between .id() and .routeId()

有什么区别

configure {
  from (blah blah)
  .id(blah)
  ....
}

configure {
  from (blah blah)
  .routeId(blah)
  .. ..
}

来自 "camel" 人。

.id 用于识别路线中的各个步骤(例如,处理器)。

另一方面,.routeId用于识别路线本身。 (您甚至可以通过提供 id 来单独关闭或打开路由,而无需关闭应用程序。)

两者都用于标识不同的语句。 .id() 用于标识路由中的语句。 .routeId() 用于识别路线。

通过添加 id,您可以在测试中使用 adviceWith() 模拟或注入或删除部分路由以执行自动化测试,而无需访问后端系统。