[
https://issues.apache.org/jira/browse/CAMEL-20777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-20777.
---------------------------------
Fix Version/s: 4.7.0
Assignee: Claus Ibsen
Resolution: Fixed
Yeah the doc is outdated for v4
> Intercept Java DSL is not supported on the route scope
> ------------------------------------------------------
>
> Key: CAMEL-20777
> URL: https://issues.apache.org/jira/browse/CAMEL-20777
> Project: Camel
> Issue Type: Task
> Reporter: Denis Istomin
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.7.0
>
>
> According to the documentation:
> [https://camel.apache.org/components/4.4.x/eips/intercept.html]
> `.intercept()` could be set on the route scope:
> {code:java}
> from("jms:queue:order")
> .intercept().to("log:hello").end() // intercepts only in this route
> .to("bean:validateOrder")
> .to("bean:processOrder");
> {code}
> But it causes a compile-time error:
> {code:java}
> cannot find symbol
> [ERROR] symbol: method intercept()
> [ERROR] location: class org.apache.camel.model.RouteDefinition
> {code}
> It is a bug in a documentation or in a Camel itself.
> If it is a bug in a documentation, then it should be explicitly said that
> `intercept()` on the route scope is not supported.
> Note: intercept can be used in AdviceWith with AdviceWithRouteBuilder:
> {code:java}
> AdviceWith.adviceWith(context, "route_id", routeBuilder -> {
> routeBuilder.intercept().to(...);
> });
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)