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

2

9

What is the difference between

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

and

configure {
  from (blah blah)
  .routeId(blah)
  .. ..
}
Pless answered 6/9, 2017 at 1:34 Comment(0)
P
12

From the "camel" guy. https://mcmap.net/q/1172042/-how-to-set-id-of-camel-processor-or-other-route-ingredients

.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.)

Priam answered 6/9, 2017 at 3:47 Comment(1)
What is the benefit of routeId?Lammergeier
S
7

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.

Stair answered 6/9, 2017 at 7:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.