You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Chirag <ch...@gmail.com> on 2023/02/28 18:39:06 UTC
Karavan + JBang + YAML DSL ; trying to use xtokenize
This is actually two questions in one:
I am trying to build YAML to perform an XML Splitter (I was able to
build one using XML DSL).
Now trying with YAML DSL.
Here is YAML that I came up with using Karavan that looks / feels
similar to XML DSL.
- route:
id: route-a6b4
from:
uri: file:/work/batchsplit/in
id: from-d1ca
steps:
- split:
id: split-6d45
expression:
xtokenize:
id: xtokenize-460a
path: //Batchmaster
mode: w
streaming: true
steps:
- to:
uri: file:/work/batchsplit/out?fileName=${exchangeId}.xml
id: to-1a10
It is erroring out:
C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
2023-02-28 13:25:15.565 INFO 5972 --- [ main]
org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
starting
2023-02-28 13:25:15.860 INFO 5972 --- [ main]
org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 5972.
Started by csanghavi in C:\work\batchsplit
2023-02-28 13:25:15.873 INFO 5972 --- [ main]
mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
Unsupported field: path
in file:batchsplitversion1.camel.yaml, line 12, column 23:
path: "//Batchmaster"
^
at org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
at org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
at org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
a) what would be the right way to provide xpath for splitting to xtokenize.
b) how to provide that using Karavan (Screenshot attached).
Info:
Karavan running within Visual Studio Code on Windows. Route running
under Jbang 3.20.2 on Windows.
Regards,
ચિરાગ/चिराग/Chirag
------------------------------------------
Sent from My Gmail Account
Re: Karavan + JBang + YAML DSL ; trying to use xtokenize
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Thanks for reporting so this morning I fixed the bug and it works in
upcoming releases.
On Thu, Mar 2, 2023 at 4:41 PM Chirag <ch...@gmail.com> wrote:
> JIRA Logged.
>
> https://issues.apache.org/jira/projects/CAMEL/issues/CAMEL-19111
>
> ચિરાગ/चिराग/Chirag
> ------------------------------------------
> Sent from My Gmail Account
>
> On Thu, Mar 2, 2023 at 9:33 AM Chirag <ch...@gmail.com> wrote:
> >
> > Thanks Claus.
> >
> > with expression containing //Batchmaster, It does not seem to like
> xtokenize
> >
> > 2023-03-02 09:29:03.391 INFO 18204 --- [ main]
> > org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
> > starting
> > 2023-03-02 09:29:03.572 INFO 18204 --- [ main]
> > org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID
> > 18204. Started by csanghavi in C:\work\batchsplit
> > 2023-03-02 09:29:03.591 INFO 18204 --- [ main]
> > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> > org.apache.camel.RuntimeCamelException: Error pre-parsing resource:
> > file:batchsplitversion1.camel.yaml
> > at
> org.apache.camel.dsl.yaml.YamlRoutesBuilderLoader.preParseRoute(YamlRoutesBuilderLoader.java:766)
> > at
> org.apache.camel.impl.engine.DefaultRoutesLoader.preParseRoute(DefaultRoutesLoader.java:138)
> > at
> org.apache.camel.main.RoutesConfigurer.configureModeline(RoutesConfigurer.java:283)
> > at
> org.apache.camel.main.BaseMainSupport.modelineRoutes(BaseMainSupport.java:629)
> > at
> org.apache.camel.main.BaseMainSupport.autoconfigure(BaseMainSupport.java:485)
> > at
> org.apache.camel.main.MainSupport.autoconfigure(MainSupport.java:74)
> > at
> org.apache.camel.main.KameletMain.autoconfigure(KameletMain.java:466)
> > at
> org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:693)
> > at
> org.apache.camel.main.MainSupport.initCamelContext(MainSupport.java:404)
> > at org.apache.camel.main.KameletMain.doInit(KameletMain.java:265)
> > at
> org.apache.camel.support.service.BaseService.init(BaseService.java:83)
> > at
> org.apache.camel.support.service.BaseService.start(BaseService.java:111)
> > at
> org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:732)
> > at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:564)
> > at
> org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:218)
> > at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:77)
> > at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
> > at picocli.CommandLine.access$1500(CommandLine.java:148)
> > at
> picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
> > at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
> > at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
> > at
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
> > at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
> > at picocli.CommandLine.execute(CommandLine.java:2170)
> > at
> org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
> > at main.CamelJBang.main(CamelJBang.java:36)
> > Caused by: mapping values are not allowed here
> > in file:batchsplitversion1.camel.yaml, line 10, column 24:
> > xtokenize:
> > ^
> >
> > at
> org.snakeyaml.engine.v2.scanner.ScannerImpl.fetchValue(ScannerImpl.java:822)
> > at
> org.snakeyaml.engine.v2.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:333)
> > at
> org.snakeyaml.engine.v2.scanner.ScannerImpl.checkToken(ScannerImpl.java:192)
> > at
> org.snakeyaml.engine.v2.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:616)
> > at
> org.snakeyaml.engine.v2.parser.ParserImpl.lambda$produce$0(ParserImpl.java:181)
> > at java.base/java.util.Optional.ifPresent(Optional.java:178)
> >
> >
> >
> > if i don't provide expression value:
> >
> > 2023-03-02 09:30:28.444 INFO 2468 --- [ main]
> > org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
> > starting
> > 2023-03-02 09:30:28.594 INFO 2468 --- [ main]
> > org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 2468.
> > Started by csanghavi in C:\work\batchsplit
> > 2023-03-02 09:30:28.611 INFO 2468 --- [ main]
> > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> > org.apache.camel.FailedToCreateRouteException: Failed to create route
> > route-a6b4 at: >>> Split[xtokenize{} ->
> > [To[file:/work/batchsplit/out?fileName=${exchangeId}.xml]]] <<< in
> > route: Route(route-a6b4)[From[file:/work/batchsplit/in] -> [Split[x...
> > because of Namespaces is not instance of java.util.Map or
> > org.apache.camel.support.builder.Namespaces
> > at
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:215)
> > at
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:75)
> > at
> org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
> > at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:937)
> > at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:800)
> > at
> org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:3008)
> > at
> org.apache.camel.support.service.BaseService.init(BaseService.java:83)
> > at
> org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2679)
> > at
> org.apache.camel.support.service.BaseService.start(BaseService.java:111)
> > at
> org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2698)
> > at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:262)
> > at
> org.apache.camel.main.KameletMain.doStart(KameletMain.java:274)
> > at
> org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> > at
> org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:732)
> > at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:564)
> > at
> org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:218)
> > at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:77)
> > at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
> > at picocli.CommandLine.access$1500(CommandLine.java:148)
> > at
> picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
> > at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
> > at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
> > at
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
> > at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
> > at picocli.CommandLine.execute(CommandLine.java:2170)
> > at
> org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
> > at main.CamelJBang.main(CamelJBang.java:36)
> > Caused by: java.lang.IllegalArgumentException: Namespaces is not
> > instance of java.util.Map or
> > org.apache.camel.support.builder.Namespaces
> > at
> org.apache.camel.language.xtokenizer.XMLTokenizeLanguage.createExpression(XMLTokenizeLanguage.java:119)
> > at
> org.apache.camel.reifier.language.XMLTokenizerExpressionReifier.createExpression(XMLTokenizerExpressionReifier.java:42)
> > at
> org.apache.camel.reifier.language.ExpressionReifier.createExpression(ExpressionReifier.java:177)
> > at
> org.apache.camel.reifier.AbstractReifier.createExpression(AbstractReifier.java:119)
> > at
> org.apache.camel.reifier.SplitReifier.createProcessor(SplitReifier.java:63)
> > at
> org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:857)
> > at
> org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:598)
> > at
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:211)
> >
> > Let me get a JIRA started.
> >
> > ચિરાગ/चिराग/Chirag
> > ------------------------------------------
> > Sent from My Gmail Account
> >
> > On Wed, Mar 1, 2023 at 4:14 PM Claus Ibsen <cl...@gmail.com>
> wrote:
> > >
> > > Hi
> > >
> > > Oh can you try using expression instead of path, so its
> > >
> > > expression:
> > > xtokenize:
> > > id: xtokenize-460a
> > > expression: //Batchmaster
> > > mode: w
> > >
> > > On Wed, Mar 1, 2023 at 10:13 PM Claus Ibsen <cl...@gmail.com>
> wrote:
> > >
> > > > Hi
> > > >
> > > > Ah there is a point that xtokenize is using @XmlValue to set that
> "path".
> > > > And the yaml-dsl is potentially not handing this correctly.
> > > > Can you create a JIRA ticket and I will try to find some time to look
> > > > at it?
> > > >
> > > > On Wed, Mar 1, 2023 at 7:35 PM Chirag <ch...@gmail.com>
> wrote:
> > > >
> > > >> I am using 3.20.0
> > > >>
> > > >>
> > > >> Here is my route in XML DSL:
> > > >> <?xml version="1.0" encoding="UTF-8"?>
> > > >> <!-- camel-k: language=xml -->
> > > >>
> > > >> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > >> xmlns="http://camel.apache.org/schema/spring"
> > > >> xsi:schemaLocation="
> > > >> http://camel.apache.org/schema/spring
> > > >> https://camel.apache.org/schema/spring/camel-spring.xsd
> ">
> > > >>
> > > >> <!-- Write your routes here, for example: -->
> > > >>
> > > >> <route>
> > > >> <from uri="file:///c://work//batchsplit//in"/>
> > > >> <split streaming="true">
> > > >> <xtokenize mode="w">//BatchMaster</xtokenize>
> > > >> <to
> uri="file:///c://work//batchsplit//out?fileName=${exchangeId}.xml"/>
> > > >> </split>
> > > >> </route>
> > > >>
> > > >> </routes>
> > > >>
> > > >>
> > > >> Trying to redefine this to be Yaml so that this could be
> > > >> edited/maintained thru Karavan.
> > > >>
> > > >> ચિરાગ/चिराग/Chirag
> > > >> ------------------------------------------
> > > >> Sent from My Gmail Account
> > > >> On Wed, Mar 1, 2023 at 1:14 AM Claus Ibsen <cl...@gmail.com>
> wrote:
> > > >> >
> > > >> > Hi
> > > >> >
> > > >> > What karavan version do you use?
> > > >> >
> > > >> > xtokenize only have
> > > >> > - mode
> > > >> > - group
> > > >> >
> > > >> > as options so it may seem you use an outdated karavan version, or
> > > >> something?
> > > >> >
> > > >> > You can try karavan online via
> > > >> > https://karavan.space/
> > > >> >
> > > >> > And I copied your code and there is no "path" in the UI. Remove
> that.
> > > >> >
> > > >> >
> > > >> >
> > > >> > On Tue, Feb 28, 2023 at 7:40 PM Chirag <chirag.sanghavi@gmail.com
> >
> > > >> wrote:
> > > >> >
> > > >> > > This is actually two questions in one:
> > > >> > >
> > > >> > > I am trying to build YAML to perform an XML Splitter (I was
> able to
> > > >> > > build one using XML DSL).
> > > >> > >
> > > >> > > Now trying with YAML DSL.
> > > >> > >
> > > >> > > Here is YAML that I came up with using Karavan that looks /
> feels
> > > >> > > similar to XML DSL.
> > > >> > > - route:
> > > >> > > id: route-a6b4
> > > >> > > from:
> > > >> > > uri: file:/work/batchsplit/in
> > > >> > > id: from-d1ca
> > > >> > > steps:
> > > >> > > - split:
> > > >> > > id: split-6d45
> > > >> > > expression:
> > > >> > > xtokenize:
> > > >> > > id: xtokenize-460a
> > > >> > > path: //Batchmaster
> > > >> > > mode: w
> > > >> > > streaming: true
> > > >> > > steps:
> > > >> > > - to:
> > > >> > > uri:
> > > >> file:/work/batchsplit/out?fileName=${exchangeId}.xml
> > > >> > > id: to-1a10
> > > >> > >
> > > >> > > It is erroring out:
> > > >> > >
> > > >> > > C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
> > > >> > > 2023-02-28 13:25:15.565 INFO 5972 --- [ main]
> > > >> > > org.apache.camel.main.MainSupport : Apache Camel (JBang)
> 3.20.2 is
> > > >> > > starting
> > > >> > > 2023-02-28 13:25:15.860 INFO 5972 --- [ main]
> > > >> > > org.apache.camel.main.MainSupport : Using Java 19.0.1 with
> PID 5972.
> > > >> > > Started by csanghavi in C:\work\batchsplit
> > > >> > > 2023-02-28 13:25:15.873 INFO 5972 --- [ main]
> > > >> > > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> > > >> > > Unsupported field: path
> > > >> > > in file:batchsplitversion1.camel.yaml, line 12, column 23:
> > > >> > > path: "//Batchmaster"
> > > >> > > ^
> > > >> > >
> > > >> > > at
> > > >> > >
> > > >>
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
> > > >> > > at
> > > >> > >
> > > >>
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
> > > >> > > at
> > > >> > >
> > > >>
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
> > > >> > >
> > > >> > > a) what would be the right way to provide xpath for splitting to
> > > >> xtokenize.
> > > >> > > b) how to provide that using Karavan (Screenshot attached).
> > > >> > >
> > > >> > > Info:
> > > >> > > Karavan running within Visual Studio Code on Windows. Route
> running
> > > >> > > under Jbang 3.20.2 on Windows.
> > > >> > >
> > > >> > > Regards,
> > > >> > >
> > > >> > > ચિરાગ/चिराग/Chirag
> > > >> > > ------------------------------------------
> > > >> > > Sent from My Gmail Account
> > > >> > >
> > > >> >
> > > >> >
> > > >> > --
> > > >> > Claus Ibsen
> > > >> > -----------------
> > > >> > @davsclaus
> > > >> > Camel in Action 2: https://www.manning.com/ibsen2
> > > >>
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -----------------
> > > > @davsclaus
> > > > Camel in Action 2: https://www.manning.com/ibsen2
> > > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
>
--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Karavan + JBang + YAML DSL ; trying to use xtokenize
Posted by Chirag <ch...@gmail.com>.
JIRA Logged.
https://issues.apache.org/jira/projects/CAMEL/issues/CAMEL-19111
ચિરાગ/चिराग/Chirag
------------------------------------------
Sent from My Gmail Account
On Thu, Mar 2, 2023 at 9:33 AM Chirag <ch...@gmail.com> wrote:
>
> Thanks Claus.
>
> with expression containing //Batchmaster, It does not seem to like xtokenize
>
> 2023-03-02 09:29:03.391 INFO 18204 --- [ main]
> org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
> starting
> 2023-03-02 09:29:03.572 INFO 18204 --- [ main]
> org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID
> 18204. Started by csanghavi in C:\work\batchsplit
> 2023-03-02 09:29:03.591 INFO 18204 --- [ main]
> mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> org.apache.camel.RuntimeCamelException: Error pre-parsing resource:
> file:batchsplitversion1.camel.yaml
> at org.apache.camel.dsl.yaml.YamlRoutesBuilderLoader.preParseRoute(YamlRoutesBuilderLoader.java:766)
> at org.apache.camel.impl.engine.DefaultRoutesLoader.preParseRoute(DefaultRoutesLoader.java:138)
> at org.apache.camel.main.RoutesConfigurer.configureModeline(RoutesConfigurer.java:283)
> at org.apache.camel.main.BaseMainSupport.modelineRoutes(BaseMainSupport.java:629)
> at org.apache.camel.main.BaseMainSupport.autoconfigure(BaseMainSupport.java:485)
> at org.apache.camel.main.MainSupport.autoconfigure(MainSupport.java:74)
> at org.apache.camel.main.KameletMain.autoconfigure(KameletMain.java:466)
> at org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:693)
> at org.apache.camel.main.MainSupport.initCamelContext(MainSupport.java:404)
> at org.apache.camel.main.KameletMain.doInit(KameletMain.java:265)
> at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
> at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
> at org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:732)
> at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:564)
> at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:218)
> at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:77)
> at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
> at picocli.CommandLine.access$1500(CommandLine.java:148)
> at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
> at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
> at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
> at picocli.CommandLine.execute(CommandLine.java:2170)
> at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
> at main.CamelJBang.main(CamelJBang.java:36)
> Caused by: mapping values are not allowed here
> in file:batchsplitversion1.camel.yaml, line 10, column 24:
> xtokenize:
> ^
>
> at org.snakeyaml.engine.v2.scanner.ScannerImpl.fetchValue(ScannerImpl.java:822)
> at org.snakeyaml.engine.v2.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:333)
> at org.snakeyaml.engine.v2.scanner.ScannerImpl.checkToken(ScannerImpl.java:192)
> at org.snakeyaml.engine.v2.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:616)
> at org.snakeyaml.engine.v2.parser.ParserImpl.lambda$produce$0(ParserImpl.java:181)
> at java.base/java.util.Optional.ifPresent(Optional.java:178)
>
>
>
> if i don't provide expression value:
>
> 2023-03-02 09:30:28.444 INFO 2468 --- [ main]
> org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
> starting
> 2023-03-02 09:30:28.594 INFO 2468 --- [ main]
> org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 2468.
> Started by csanghavi in C:\work\batchsplit
> 2023-03-02 09:30:28.611 INFO 2468 --- [ main]
> mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> route-a6b4 at: >>> Split[xtokenize{} ->
> [To[file:/work/batchsplit/out?fileName=${exchangeId}.xml]]] <<< in
> route: Route(route-a6b4)[From[file:/work/batchsplit/in] -> [Split[x...
> because of Namespaces is not instance of java.util.Map or
> org.apache.camel.support.builder.Namespaces
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:215)
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:75)
> at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
> at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:937)
> at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:800)
> at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:3008)
> at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
> at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2679)
> at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
> at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2698)
> at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:262)
> at org.apache.camel.main.KameletMain.doStart(KameletMain.java:274)
> at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> at org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:732)
> at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:564)
> at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:218)
> at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:77)
> at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
> at picocli.CommandLine.access$1500(CommandLine.java:148)
> at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
> at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
> at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
> at picocli.CommandLine.execute(CommandLine.java:2170)
> at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
> at main.CamelJBang.main(CamelJBang.java:36)
> Caused by: java.lang.IllegalArgumentException: Namespaces is not
> instance of java.util.Map or
> org.apache.camel.support.builder.Namespaces
> at org.apache.camel.language.xtokenizer.XMLTokenizeLanguage.createExpression(XMLTokenizeLanguage.java:119)
> at org.apache.camel.reifier.language.XMLTokenizerExpressionReifier.createExpression(XMLTokenizerExpressionReifier.java:42)
> at org.apache.camel.reifier.language.ExpressionReifier.createExpression(ExpressionReifier.java:177)
> at org.apache.camel.reifier.AbstractReifier.createExpression(AbstractReifier.java:119)
> at org.apache.camel.reifier.SplitReifier.createProcessor(SplitReifier.java:63)
> at org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:857)
> at org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:598)
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:211)
>
> Let me get a JIRA started.
>
> ચિરાગ/चिराग/Chirag
> ------------------------------------------
> Sent from My Gmail Account
>
> On Wed, Mar 1, 2023 at 4:14 PM Claus Ibsen <cl...@gmail.com> wrote:
> >
> > Hi
> >
> > Oh can you try using expression instead of path, so its
> >
> > expression:
> > xtokenize:
> > id: xtokenize-460a
> > expression: //Batchmaster
> > mode: w
> >
> > On Wed, Mar 1, 2023 at 10:13 PM Claus Ibsen <cl...@gmail.com> wrote:
> >
> > > Hi
> > >
> > > Ah there is a point that xtokenize is using @XmlValue to set that "path".
> > > And the yaml-dsl is potentially not handing this correctly.
> > > Can you create a JIRA ticket and I will try to find some time to look
> > > at it?
> > >
> > > On Wed, Mar 1, 2023 at 7:35 PM Chirag <ch...@gmail.com> wrote:
> > >
> > >> I am using 3.20.0
> > >>
> > >>
> > >> Here is my route in XML DSL:
> > >> <?xml version="1.0" encoding="UTF-8"?>
> > >> <!-- camel-k: language=xml -->
> > >>
> > >> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > >> xmlns="http://camel.apache.org/schema/spring"
> > >> xsi:schemaLocation="
> > >> http://camel.apache.org/schema/spring
> > >> https://camel.apache.org/schema/spring/camel-spring.xsd">
> > >>
> > >> <!-- Write your routes here, for example: -->
> > >>
> > >> <route>
> > >> <from uri="file:///c://work//batchsplit//in"/>
> > >> <split streaming="true">
> > >> <xtokenize mode="w">//BatchMaster</xtokenize>
> > >> <to uri="file:///c://work//batchsplit//out?fileName=${exchangeId}.xml"/>
> > >> </split>
> > >> </route>
> > >>
> > >> </routes>
> > >>
> > >>
> > >> Trying to redefine this to be Yaml so that this could be
> > >> edited/maintained thru Karavan.
> > >>
> > >> ચિરાગ/चिराग/Chirag
> > >> ------------------------------------------
> > >> Sent from My Gmail Account
> > >> On Wed, Mar 1, 2023 at 1:14 AM Claus Ibsen <cl...@gmail.com> wrote:
> > >> >
> > >> > Hi
> > >> >
> > >> > What karavan version do you use?
> > >> >
> > >> > xtokenize only have
> > >> > - mode
> > >> > - group
> > >> >
> > >> > as options so it may seem you use an outdated karavan version, or
> > >> something?
> > >> >
> > >> > You can try karavan online via
> > >> > https://karavan.space/
> > >> >
> > >> > And I copied your code and there is no "path" in the UI. Remove that.
> > >> >
> > >> >
> > >> >
> > >> > On Tue, Feb 28, 2023 at 7:40 PM Chirag <ch...@gmail.com>
> > >> wrote:
> > >> >
> > >> > > This is actually two questions in one:
> > >> > >
> > >> > > I am trying to build YAML to perform an XML Splitter (I was able to
> > >> > > build one using XML DSL).
> > >> > >
> > >> > > Now trying with YAML DSL.
> > >> > >
> > >> > > Here is YAML that I came up with using Karavan that looks / feels
> > >> > > similar to XML DSL.
> > >> > > - route:
> > >> > > id: route-a6b4
> > >> > > from:
> > >> > > uri: file:/work/batchsplit/in
> > >> > > id: from-d1ca
> > >> > > steps:
> > >> > > - split:
> > >> > > id: split-6d45
> > >> > > expression:
> > >> > > xtokenize:
> > >> > > id: xtokenize-460a
> > >> > > path: //Batchmaster
> > >> > > mode: w
> > >> > > streaming: true
> > >> > > steps:
> > >> > > - to:
> > >> > > uri:
> > >> file:/work/batchsplit/out?fileName=${exchangeId}.xml
> > >> > > id: to-1a10
> > >> > >
> > >> > > It is erroring out:
> > >> > >
> > >> > > C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
> > >> > > 2023-02-28 13:25:15.565 INFO 5972 --- [ main]
> > >> > > org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
> > >> > > starting
> > >> > > 2023-02-28 13:25:15.860 INFO 5972 --- [ main]
> > >> > > org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 5972.
> > >> > > Started by csanghavi in C:\work\batchsplit
> > >> > > 2023-02-28 13:25:15.873 INFO 5972 --- [ main]
> > >> > > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> > >> > > Unsupported field: path
> > >> > > in file:batchsplitversion1.camel.yaml, line 12, column 23:
> > >> > > path: "//Batchmaster"
> > >> > > ^
> > >> > >
> > >> > > at
> > >> > >
> > >> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
> > >> > > at
> > >> > >
> > >> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
> > >> > > at
> > >> > >
> > >> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
> > >> > >
> > >> > > a) what would be the right way to provide xpath for splitting to
> > >> xtokenize.
> > >> > > b) how to provide that using Karavan (Screenshot attached).
> > >> > >
> > >> > > Info:
> > >> > > Karavan running within Visual Studio Code on Windows. Route running
> > >> > > under Jbang 3.20.2 on Windows.
> > >> > >
> > >> > > Regards,
> > >> > >
> > >> > > ચિરાગ/चिराग/Chirag
> > >> > > ------------------------------------------
> > >> > > Sent from My Gmail Account
> > >> > >
> > >> >
> > >> >
> > >> > --
> > >> > Claus Ibsen
> > >> > -----------------
> > >> > @davsclaus
> > >> > Camel in Action 2: https://www.manning.com/ibsen2
> > >>
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
> > >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
Re: Karavan + JBang + YAML DSL ; trying to use xtokenize
Posted by Chirag <ch...@gmail.com>.
Thanks Claus.
with expression containing //Batchmaster, It does not seem to like xtokenize
2023-03-02 09:29:03.391 INFO 18204 --- [ main]
org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
starting
2023-03-02 09:29:03.572 INFO 18204 --- [ main]
org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID
18204. Started by csanghavi in C:\work\batchsplit
2023-03-02 09:29:03.591 INFO 18204 --- [ main]
mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
org.apache.camel.RuntimeCamelException: Error pre-parsing resource:
file:batchsplitversion1.camel.yaml
at org.apache.camel.dsl.yaml.YamlRoutesBuilderLoader.preParseRoute(YamlRoutesBuilderLoader.java:766)
at org.apache.camel.impl.engine.DefaultRoutesLoader.preParseRoute(DefaultRoutesLoader.java:138)
at org.apache.camel.main.RoutesConfigurer.configureModeline(RoutesConfigurer.java:283)
at org.apache.camel.main.BaseMainSupport.modelineRoutes(BaseMainSupport.java:629)
at org.apache.camel.main.BaseMainSupport.autoconfigure(BaseMainSupport.java:485)
at org.apache.camel.main.MainSupport.autoconfigure(MainSupport.java:74)
at org.apache.camel.main.KameletMain.autoconfigure(KameletMain.java:466)
at org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:693)
at org.apache.camel.main.MainSupport.initCamelContext(MainSupport.java:404)
at org.apache.camel.main.KameletMain.doInit(KameletMain.java:265)
at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
at org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:732)
at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:564)
at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:218)
at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:77)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
at main.CamelJBang.main(CamelJBang.java:36)
Caused by: mapping values are not allowed here
in file:batchsplitversion1.camel.yaml, line 10, column 24:
xtokenize:
^
at org.snakeyaml.engine.v2.scanner.ScannerImpl.fetchValue(ScannerImpl.java:822)
at org.snakeyaml.engine.v2.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:333)
at org.snakeyaml.engine.v2.scanner.ScannerImpl.checkToken(ScannerImpl.java:192)
at org.snakeyaml.engine.v2.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:616)
at org.snakeyaml.engine.v2.parser.ParserImpl.lambda$produce$0(ParserImpl.java:181)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
if i don't provide expression value:
2023-03-02 09:30:28.444 INFO 2468 --- [ main]
org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
starting
2023-03-02 09:30:28.594 INFO 2468 --- [ main]
org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 2468.
Started by csanghavi in C:\work\batchsplit
2023-03-02 09:30:28.611 INFO 2468 --- [ main]
mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
org.apache.camel.FailedToCreateRouteException: Failed to create route
route-a6b4 at: >>> Split[xtokenize{} ->
[To[file:/work/batchsplit/out?fileName=${exchangeId}.xml]]] <<< in
route: Route(route-a6b4)[From[file:/work/batchsplit/in] -> [Split[x...
because of Namespaces is not instance of java.util.Map or
org.apache.camel.support.builder.Namespaces
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:215)
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:75)
at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:937)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:800)
at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:3008)
at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2679)
at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2698)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:262)
at org.apache.camel.main.KameletMain.doStart(KameletMain.java:274)
at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
at org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:732)
at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:564)
at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:218)
at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:77)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
at main.CamelJBang.main(CamelJBang.java:36)
Caused by: java.lang.IllegalArgumentException: Namespaces is not
instance of java.util.Map or
org.apache.camel.support.builder.Namespaces
at org.apache.camel.language.xtokenizer.XMLTokenizeLanguage.createExpression(XMLTokenizeLanguage.java:119)
at org.apache.camel.reifier.language.XMLTokenizerExpressionReifier.createExpression(XMLTokenizerExpressionReifier.java:42)
at org.apache.camel.reifier.language.ExpressionReifier.createExpression(ExpressionReifier.java:177)
at org.apache.camel.reifier.AbstractReifier.createExpression(AbstractReifier.java:119)
at org.apache.camel.reifier.SplitReifier.createProcessor(SplitReifier.java:63)
at org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:857)
at org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:598)
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:211)
Let me get a JIRA started.
ચિરાગ/चिराग/Chirag
------------------------------------------
Sent from My Gmail Account
On Wed, Mar 1, 2023 at 4:14 PM Claus Ibsen <cl...@gmail.com> wrote:
>
> Hi
>
> Oh can you try using expression instead of path, so its
>
> expression:
> xtokenize:
> id: xtokenize-460a
> expression: //Batchmaster
> mode: w
>
> On Wed, Mar 1, 2023 at 10:13 PM Claus Ibsen <cl...@gmail.com> wrote:
>
> > Hi
> >
> > Ah there is a point that xtokenize is using @XmlValue to set that "path".
> > And the yaml-dsl is potentially not handing this correctly.
> > Can you create a JIRA ticket and I will try to find some time to look
> > at it?
> >
> > On Wed, Mar 1, 2023 at 7:35 PM Chirag <ch...@gmail.com> wrote:
> >
> >> I am using 3.20.0
> >>
> >>
> >> Here is my route in XML DSL:
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <!-- camel-k: language=xml -->
> >>
> >> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> xmlns="http://camel.apache.org/schema/spring"
> >> xsi:schemaLocation="
> >> http://camel.apache.org/schema/spring
> >> https://camel.apache.org/schema/spring/camel-spring.xsd">
> >>
> >> <!-- Write your routes here, for example: -->
> >>
> >> <route>
> >> <from uri="file:///c://work//batchsplit//in"/>
> >> <split streaming="true">
> >> <xtokenize mode="w">//BatchMaster</xtokenize>
> >> <to uri="file:///c://work//batchsplit//out?fileName=${exchangeId}.xml"/>
> >> </split>
> >> </route>
> >>
> >> </routes>
> >>
> >>
> >> Trying to redefine this to be Yaml so that this could be
> >> edited/maintained thru Karavan.
> >>
> >> ચિરાગ/चिराग/Chirag
> >> ------------------------------------------
> >> Sent from My Gmail Account
> >> On Wed, Mar 1, 2023 at 1:14 AM Claus Ibsen <cl...@gmail.com> wrote:
> >> >
> >> > Hi
> >> >
> >> > What karavan version do you use?
> >> >
> >> > xtokenize only have
> >> > - mode
> >> > - group
> >> >
> >> > as options so it may seem you use an outdated karavan version, or
> >> something?
> >> >
> >> > You can try karavan online via
> >> > https://karavan.space/
> >> >
> >> > And I copied your code and there is no "path" in the UI. Remove that.
> >> >
> >> >
> >> >
> >> > On Tue, Feb 28, 2023 at 7:40 PM Chirag <ch...@gmail.com>
> >> wrote:
> >> >
> >> > > This is actually two questions in one:
> >> > >
> >> > > I am trying to build YAML to perform an XML Splitter (I was able to
> >> > > build one using XML DSL).
> >> > >
> >> > > Now trying with YAML DSL.
> >> > >
> >> > > Here is YAML that I came up with using Karavan that looks / feels
> >> > > similar to XML DSL.
> >> > > - route:
> >> > > id: route-a6b4
> >> > > from:
> >> > > uri: file:/work/batchsplit/in
> >> > > id: from-d1ca
> >> > > steps:
> >> > > - split:
> >> > > id: split-6d45
> >> > > expression:
> >> > > xtokenize:
> >> > > id: xtokenize-460a
> >> > > path: //Batchmaster
> >> > > mode: w
> >> > > streaming: true
> >> > > steps:
> >> > > - to:
> >> > > uri:
> >> file:/work/batchsplit/out?fileName=${exchangeId}.xml
> >> > > id: to-1a10
> >> > >
> >> > > It is erroring out:
> >> > >
> >> > > C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
> >> > > 2023-02-28 13:25:15.565 INFO 5972 --- [ main]
> >> > > org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
> >> > > starting
> >> > > 2023-02-28 13:25:15.860 INFO 5972 --- [ main]
> >> > > org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 5972.
> >> > > Started by csanghavi in C:\work\batchsplit
> >> > > 2023-02-28 13:25:15.873 INFO 5972 --- [ main]
> >> > > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> >> > > Unsupported field: path
> >> > > in file:batchsplitversion1.camel.yaml, line 12, column 23:
> >> > > path: "//Batchmaster"
> >> > > ^
> >> > >
> >> > > at
> >> > >
> >> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
> >> > > at
> >> > >
> >> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
> >> > > at
> >> > >
> >> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
> >> > >
> >> > > a) what would be the right way to provide xpath for splitting to
> >> xtokenize.
> >> > > b) how to provide that using Karavan (Screenshot attached).
> >> > >
> >> > > Info:
> >> > > Karavan running within Visual Studio Code on Windows. Route running
> >> > > under Jbang 3.20.2 on Windows.
> >> > >
> >> > > Regards,
> >> > >
> >> > > ચિરાગ/चिराग/Chirag
> >> > > ------------------------------------------
> >> > > Sent from My Gmail Account
> >> > >
> >> >
> >> >
> >> > --
> >> > Claus Ibsen
> >> > -----------------
> >> > @davsclaus
> >> > Camel in Action 2: https://www.manning.com/ibsen2
> >>
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
Re: Karavan + JBang + YAML DSL ; trying to use xtokenize
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Oh can you try using expression instead of path, so its
expression:
xtokenize:
id: xtokenize-460a
expression: //Batchmaster
mode: w
On Wed, Mar 1, 2023 at 10:13 PM Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Ah there is a point that xtokenize is using @XmlValue to set that "path".
> And the yaml-dsl is potentially not handing this correctly.
> Can you create a JIRA ticket and I will try to find some time to look
> at it?
>
> On Wed, Mar 1, 2023 at 7:35 PM Chirag <ch...@gmail.com> wrote:
>
>> I am using 3.20.0
>>
>>
>> Here is my route in XML DSL:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!-- camel-k: language=xml -->
>>
>> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns="http://camel.apache.org/schema/spring"
>> xsi:schemaLocation="
>> http://camel.apache.org/schema/spring
>> https://camel.apache.org/schema/spring/camel-spring.xsd">
>>
>> <!-- Write your routes here, for example: -->
>>
>> <route>
>> <from uri="file:///c://work//batchsplit//in"/>
>> <split streaming="true">
>> <xtokenize mode="w">//BatchMaster</xtokenize>
>> <to uri="file:///c://work//batchsplit//out?fileName=${exchangeId}.xml"/>
>> </split>
>> </route>
>>
>> </routes>
>>
>>
>> Trying to redefine this to be Yaml so that this could be
>> edited/maintained thru Karavan.
>>
>> ચિરાગ/चिराग/Chirag
>> ------------------------------------------
>> Sent from My Gmail Account
>> On Wed, Mar 1, 2023 at 1:14 AM Claus Ibsen <cl...@gmail.com> wrote:
>> >
>> > Hi
>> >
>> > What karavan version do you use?
>> >
>> > xtokenize only have
>> > - mode
>> > - group
>> >
>> > as options so it may seem you use an outdated karavan version, or
>> something?
>> >
>> > You can try karavan online via
>> > https://karavan.space/
>> >
>> > And I copied your code and there is no "path" in the UI. Remove that.
>> >
>> >
>> >
>> > On Tue, Feb 28, 2023 at 7:40 PM Chirag <ch...@gmail.com>
>> wrote:
>> >
>> > > This is actually two questions in one:
>> > >
>> > > I am trying to build YAML to perform an XML Splitter (I was able to
>> > > build one using XML DSL).
>> > >
>> > > Now trying with YAML DSL.
>> > >
>> > > Here is YAML that I came up with using Karavan that looks / feels
>> > > similar to XML DSL.
>> > > - route:
>> > > id: route-a6b4
>> > > from:
>> > > uri: file:/work/batchsplit/in
>> > > id: from-d1ca
>> > > steps:
>> > > - split:
>> > > id: split-6d45
>> > > expression:
>> > > xtokenize:
>> > > id: xtokenize-460a
>> > > path: //Batchmaster
>> > > mode: w
>> > > streaming: true
>> > > steps:
>> > > - to:
>> > > uri:
>> file:/work/batchsplit/out?fileName=${exchangeId}.xml
>> > > id: to-1a10
>> > >
>> > > It is erroring out:
>> > >
>> > > C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
>> > > 2023-02-28 13:25:15.565 INFO 5972 --- [ main]
>> > > org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
>> > > starting
>> > > 2023-02-28 13:25:15.860 INFO 5972 --- [ main]
>> > > org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 5972.
>> > > Started by csanghavi in C:\work\batchsplit
>> > > 2023-02-28 13:25:15.873 INFO 5972 --- [ main]
>> > > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
>> > > Unsupported field: path
>> > > in file:batchsplitversion1.camel.yaml, line 12, column 23:
>> > > path: "//Batchmaster"
>> > > ^
>> > >
>> > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
>> > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
>> > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
>> > >
>> > > a) what would be the right way to provide xpath for splitting to
>> xtokenize.
>> > > b) how to provide that using Karavan (Screenshot attached).
>> > >
>> > > Info:
>> > > Karavan running within Visual Studio Code on Windows. Route running
>> > > under Jbang 3.20.2 on Windows.
>> > >
>> > > Regards,
>> > >
>> > > ચિરાગ/चिराग/Chirag
>> > > ------------------------------------------
>> > > Sent from My Gmail Account
>> > >
>> >
>> >
>> > --
>> > Claus Ibsen
>> > -----------------
>> > @davsclaus
>> > Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>
--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Karavan + JBang + YAML DSL ; trying to use xtokenize
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Ah there is a point that xtokenize is using @XmlValue to set that "path".
And the yaml-dsl is potentially not handing this correctly.
Can you create a JIRA ticket and I will try to find some time to look at it?
On Wed, Mar 1, 2023 at 7:35 PM Chirag <ch...@gmail.com> wrote:
> I am using 3.20.0
>
>
> Here is my route in XML DSL:
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- camel-k: language=xml -->
>
> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://camel.apache.org/schema/spring"
> xsi:schemaLocation="
> http://camel.apache.org/schema/spring
> https://camel.apache.org/schema/spring/camel-spring.xsd">
>
> <!-- Write your routes here, for example: -->
>
> <route>
> <from uri="file:///c://work//batchsplit//in"/>
> <split streaming="true">
> <xtokenize mode="w">//BatchMaster</xtokenize>
> <to uri="file:///c://work//batchsplit//out?fileName=${exchangeId}.xml"/>
> </split>
> </route>
>
> </routes>
>
>
> Trying to redefine this to be Yaml so that this could be
> edited/maintained thru Karavan.
>
> ચિરાગ/चिराग/Chirag
> ------------------------------------------
> Sent from My Gmail Account
> On Wed, Mar 1, 2023 at 1:14 AM Claus Ibsen <cl...@gmail.com> wrote:
> >
> > Hi
> >
> > What karavan version do you use?
> >
> > xtokenize only have
> > - mode
> > - group
> >
> > as options so it may seem you use an outdated karavan version, or
> something?
> >
> > You can try karavan online via
> > https://karavan.space/
> >
> > And I copied your code and there is no "path" in the UI. Remove that.
> >
> >
> >
> > On Tue, Feb 28, 2023 at 7:40 PM Chirag <ch...@gmail.com>
> wrote:
> >
> > > This is actually two questions in one:
> > >
> > > I am trying to build YAML to perform an XML Splitter (I was able to
> > > build one using XML DSL).
> > >
> > > Now trying with YAML DSL.
> > >
> > > Here is YAML that I came up with using Karavan that looks / feels
> > > similar to XML DSL.
> > > - route:
> > > id: route-a6b4
> > > from:
> > > uri: file:/work/batchsplit/in
> > > id: from-d1ca
> > > steps:
> > > - split:
> > > id: split-6d45
> > > expression:
> > > xtokenize:
> > > id: xtokenize-460a
> > > path: //Batchmaster
> > > mode: w
> > > streaming: true
> > > steps:
> > > - to:
> > > uri:
> file:/work/batchsplit/out?fileName=${exchangeId}.xml
> > > id: to-1a10
> > >
> > > It is erroring out:
> > >
> > > C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
> > > 2023-02-28 13:25:15.565 INFO 5972 --- [ main]
> > > org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
> > > starting
> > > 2023-02-28 13:25:15.860 INFO 5972 --- [ main]
> > > org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 5972.
> > > Started by csanghavi in C:\work\batchsplit
> > > 2023-02-28 13:25:15.873 INFO 5972 --- [ main]
> > > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> > > Unsupported field: path
> > > in file:batchsplitversion1.camel.yaml, line 12, column 23:
> > > path: "//Batchmaster"
> > > ^
> > >
> > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
> > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
> > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
> > >
> > > a) what would be the right way to provide xpath for splitting to
> xtokenize.
> > > b) how to provide that using Karavan (Screenshot attached).
> > >
> > > Info:
> > > Karavan running within Visual Studio Code on Windows. Route running
> > > under Jbang 3.20.2 on Windows.
> > >
> > > Regards,
> > >
> > > ચિરાગ/चिराग/Chirag
> > > ------------------------------------------
> > > Sent from My Gmail Account
> > >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>
--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Karavan + JBang + YAML DSL ; trying to use xtokenize
Posted by Chirag <ch...@gmail.com>.
I am using 3.20.0
Here is my route in XML DSL:
<?xml version="1.0" encoding="UTF-8"?>
<!-- camel-k: language=xml -->
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://camel.apache.org/schema/spring
https://camel.apache.org/schema/spring/camel-spring.xsd">
<!-- Write your routes here, for example: -->
<route>
<from uri="file:///c://work//batchsplit//in"/>
<split streaming="true">
<xtokenize mode="w">//BatchMaster</xtokenize>
<to uri="file:///c://work//batchsplit//out?fileName=${exchangeId}.xml"/>
</split>
</route>
</routes>
Trying to redefine this to be Yaml so that this could be
edited/maintained thru Karavan.
ચિરાગ/चिराग/Chirag
------------------------------------------
Sent from My Gmail Account
On Wed, Mar 1, 2023 at 1:14 AM Claus Ibsen <cl...@gmail.com> wrote:
>
> Hi
>
> What karavan version do you use?
>
> xtokenize only have
> - mode
> - group
>
> as options so it may seem you use an outdated karavan version, or something?
>
> You can try karavan online via
> https://karavan.space/
>
> And I copied your code and there is no "path" in the UI. Remove that.
>
>
>
> On Tue, Feb 28, 2023 at 7:40 PM Chirag <ch...@gmail.com> wrote:
>
> > This is actually two questions in one:
> >
> > I am trying to build YAML to perform an XML Splitter (I was able to
> > build one using XML DSL).
> >
> > Now trying with YAML DSL.
> >
> > Here is YAML that I came up with using Karavan that looks / feels
> > similar to XML DSL.
> > - route:
> > id: route-a6b4
> > from:
> > uri: file:/work/batchsplit/in
> > id: from-d1ca
> > steps:
> > - split:
> > id: split-6d45
> > expression:
> > xtokenize:
> > id: xtokenize-460a
> > path: //Batchmaster
> > mode: w
> > streaming: true
> > steps:
> > - to:
> > uri: file:/work/batchsplit/out?fileName=${exchangeId}.xml
> > id: to-1a10
> >
> > It is erroring out:
> >
> > C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
> > 2023-02-28 13:25:15.565 INFO 5972 --- [ main]
> > org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
> > starting
> > 2023-02-28 13:25:15.860 INFO 5972 --- [ main]
> > org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 5972.
> > Started by csanghavi in C:\work\batchsplit
> > 2023-02-28 13:25:15.873 INFO 5972 --- [ main]
> > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> > Unsupported field: path
> > in file:batchsplitversion1.camel.yaml, line 12, column 23:
> > path: "//Batchmaster"
> > ^
> >
> > at
> > org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
> > at
> > org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
> > at
> > org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
> >
> > a) what would be the right way to provide xpath for splitting to xtokenize.
> > b) how to provide that using Karavan (Screenshot attached).
> >
> > Info:
> > Karavan running within Visual Studio Code on Windows. Route running
> > under Jbang 3.20.2 on Windows.
> >
> > Regards,
> >
> > ચિરાગ/चिराग/Chirag
> > ------------------------------------------
> > Sent from My Gmail Account
> >
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
Re: Karavan + JBang + YAML DSL ; trying to use xtokenize
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
What karavan version do you use?
xtokenize only have
- mode
- group
as options so it may seem you use an outdated karavan version, or something?
You can try karavan online via
https://karavan.space/
And I copied your code and there is no "path" in the UI. Remove that.
On Tue, Feb 28, 2023 at 7:40 PM Chirag <ch...@gmail.com> wrote:
> This is actually two questions in one:
>
> I am trying to build YAML to perform an XML Splitter (I was able to
> build one using XML DSL).
>
> Now trying with YAML DSL.
>
> Here is YAML that I came up with using Karavan that looks / feels
> similar to XML DSL.
> - route:
> id: route-a6b4
> from:
> uri: file:/work/batchsplit/in
> id: from-d1ca
> steps:
> - split:
> id: split-6d45
> expression:
> xtokenize:
> id: xtokenize-460a
> path: //Batchmaster
> mode: w
> streaming: true
> steps:
> - to:
> uri: file:/work/batchsplit/out?fileName=${exchangeId}.xml
> id: to-1a10
>
> It is erroring out:
>
> C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
> 2023-02-28 13:25:15.565 INFO 5972 --- [ main]
> org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is
> starting
> 2023-02-28 13:25:15.860 INFO 5972 --- [ main]
> org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 5972.
> Started by csanghavi in C:\work\batchsplit
> 2023-02-28 13:25:15.873 INFO 5972 --- [ main]
> mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> Unsupported field: path
> in file:batchsplitversion1.camel.yaml, line 12, column 23:
> path: "//Batchmaster"
> ^
>
> at
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
> at
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
> at
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
>
> a) what would be the right way to provide xpath for splitting to xtokenize.
> b) how to provide that using Karavan (Screenshot attached).
>
> Info:
> Karavan running within Visual Studio Code on Windows. Route running
> under Jbang 3.20.2 on Windows.
>
> Regards,
>
> ચિરાગ/चिराग/Chirag
> ------------------------------------------
> Sent from My Gmail Account
>
--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2