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

5.1k views Asked by At

What is the difference between

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

and

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

There are 2 answers

1
so-random-dude On BEST ANSWER

From the "camel" guy. https://stackoverflow.com/a/28579582/6785908

.id is for Identifying individual steps (for Example, processors) in a Route.

On the other hand, .routeId is for Identifying the route itself. (You can even bring a route alone down or up by giving the id, without bringing down the application.)

0
Souciance Eqdam Rashti On

Both are used for identifying different statements. .id() is for identifying statements in a route. .routeId() are for identifying routes.

By adding ids you can in your tests use adviceWith() to mock or inject or remove parts of your route to perform automated tests without having access to backend systems.