[ https://issues.apache.org/jira/browse/CAMEL-19450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17732363#comment-17732363 ]
Claus Ibsen commented on CAMEL-19450: ------------------------------------- Its a bit "ugly" as its an array, so you need to do like this {code} - routeConfiguration: intercept: - intercept: id: intercept-9b31 steps: - log: message: Interceptor ${body} id: log-c2f5 - route: id: route-ddaa from: uri: kamelet:timer-source id: from-847d parameters: message: Hello steps: - log: message: Main ${body} id: log-7972 {code} > Interceptor does not work in YAML DSL > ------------------------------------- > > Key: CAMEL-19450 > URL: https://issues.apache.org/jira/browse/CAMEL-19450 > Project: Camel > Issue Type: Bug > Affects Versions: 3.20.5 > Reporter: Marat Gubaidullin > Priority: Minor > > YAML DSL used > {code:java} > - routeConfiguration: > intercept: > - id: intercept-9b31 > steps: > - log: > message: Interceptor ${body} > id: log-c2f5 > - route: > id: route-ddaa > from: > uri: kamelet:timer-source > id: from-847d > parameters: > message: Hello > steps: > - log: > message: Main ${body} > id: log-7972 > {code} > Result: > {code:java} > 2023-06-13 16:25:52.478 INFO 37141 --- [ main] > org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.5 is starting > 2023-06-13 16:25:52.799 INFO 37141 --- [ main] > org.apache.camel.main.MainSupport : Using Java 11.0.7 with PID 37141. > Started by marat in /Users/marat/projects/test/karavan > 2023-06-13 16:25:52.821 INFO 37141 --- [ main] > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local) > 2023-06-13 16:25:53.456 INFO 37141 --- [ main] > g.apache.camel.main.BaseMainSupport : Auto-configuration summary > 2023-06-13 16:25:53.457 INFO 37141 --- [ main] > g.apache.camel.main.BaseMainSupport : [application.properties] > camel.health.enabled=true > 2023-06-13 16:25:53.457 INFO 37141 --- [ main] > g.apache.camel.main.BaseMainSupport : [application.properties] > camel.health.exposureLevel=full > Node should have only have 1 key, was: 2 keys: [id,steps] (Maybe this is an > indent problem in the YAML source). > in file:demo.camel.yaml, line 3, column 9: > - id: intercept-9b31 > ^ > at > org.apache.camel.dsl.yaml.common.YamlDeserializationContext.resolve(YamlDeserializationContext.java:193) > at > org.apache.camel.dsl.yaml.common.YamlDeserializationContext.mandatoryResolve(YamlDeserializationContext.java:178) > at > org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asCollection(YamlDeserializerSupport.java:324) > at > org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asCollection(YamlDeserializerSupport.java:303) > at > org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asList(YamlDeserializerSupport.java:284) > at > org.apache.camel.dsl.yaml.deserializers.RouteConfigurationDefinitionDeserializer.construct(RouteConfigurationDefinitionDeserializer.java:101) > at > org.apache.camel.dsl.yaml.common.YamlDeserializationContext$2.construct(YamlDeserializationContext.java:215) > at > org.apache.camel.dsl.yaml.YamlRoutesBuilderLoader$1.configuration(YamlRoutesBuilderLoader.java:270) > at > org.apache.camel.builder.RouteConfigurationBuilder.addRouteConfigurationsToCamelContext(RouteConfigurationBuilder.java:78) > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)