Hi Claus,
so, I can write my XML as follow?
<bean id="zipFileDataFormat" class="org.apache.camel.dataformat.zipfile.
ZipFileDataFormat">
<property name="usingIterator" value="true"/>
</bean>
.......
<endpoint id="to-import" uri="file://${to-import-dir}?
include=.*.zip"/>
<endpoint id="to-archive" uri="file://${to-archive-dir}"/>
<endpoint id="to-error" uri="file://${to-error-dir}"/>
<route>
<from uri="ref:to-import" />
<unmarshal ref="zipFileDataFormat"/>
<split streaming="true">
<simple>${body}</simple>
<to uri="ref:to-import" />
</split>
<process ref="dataImport" />
<choice>
<when>
<simple>${header.result} == 'true'</simple>
<to uri="ref:to-archive" />
</when>
<otherwise>
<to uri="ref:to-error" />
</otherwise>
</choice>
</route>
To better understand, the zip file contains a dir with several files and I
need to start process on the entire dir not file to file.
Matteo Cusmai
On Sun, May 21, 2017 at 10:45 AM, Claus Ibsen <[email protected]> wrote:
> The end() is just the corresponding XML end tag, eg </split> or </choice>
> etc
>
> On Sun, May 21, 2017 at 10:32 AM, Matteo Cusmai <[email protected]>
> wrote:
> > Hi all,
> > I would like to write the following DSL route in XML fashion, but I don't
> > find how to specify the end() tag.
> >
> > public void configure() throws Exception {
> > ZipFileDataFormat zipFile = new ZipFileDataFormat();
> > zipFile.setUsingIterator(true);
> > from("file://" + dir + "?delete=true&moveFailed=" + errorDir +
> > "&include=.*.zip")
> > .split(new ZipSplitter())
> > .streaming()
> > .to("file://" + dir + "?include=.*.zip")
> > *.end()*
> > .process(proc)
> > .choice()
> > .when(header("result").isEqualTo("true")).to("file://" +
> archiveDirectory)
> > .when(header("result").isEqualTo("false")).to("file://" +
> errorDirectory)
> > .endChoice();
> > }
> >
> > There is a way to do this in XML?
> > Thanks a lot,
> >
> > Matteo
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>