You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by souciance <so...@gmail.com> on 2016/09/08 18:16:52 UTC

PollEnrich with file language

Hi,

Does pollEnrich work properly with the file language?

I have written a simple statement that moves the file after polling and adds
a timestamp to the file. However the output is that it creates a folder with
the timestamp name and ignores the filename and file extension.
This is my statement..

.pollEnrich("...&move=importArchive/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}")

Instead it creates a folder inside importArchive with the name based on
-${date:now:yyyyMMddHHmmssSSS}

Best
Souciance



--
View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: PollEnrich with file language

Posted by souciance <so...@gmail.com>.
The strange thing is, it does not matter what expression I use, anything
after &move= turns into a folder. I think pollEnrich with dynamic endpoints
has an issue with move.

Basically this fails:

pollEnrich().simple("file:" + folder +
"?fileName=${header.File}&charset=iso-8859-1&move=archive/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}")

It simply creates a folder with the timestamp name and ignores the File
expressions.

My workaround was to use a Processor and a ConsumerTemplate and send in the
file URI. That worked.

On Fri, Sep 9, 2016 at 11:29 AM, souciance [via Camel] <
ml-node+s465427n5787409h42@n5.nabble.com> wrote:

> I am on 2.17.0 and for the life of me cannot get it to work.
>
> I am using this:
>
>    .pollEnrich().simple("file:" + location + "?fileName=${header.File}&charset=iso-8859-1&"
> +
>             "move=../archive/${file:name.noext}-${date:now:yyyyMMddHHmm}.${file:ext}")
>
>
> All it does is create the archive folder and then it seems to ignore the
> File language parts and just creates a folder with the name -<date> and
> puts the filer there.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/PollEnrich-with-file-
> language-tp5787380p5787409.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from PollEnrich with file language, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5787380&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NTc4NzM4MHwxNTMyOTExNjU2>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787419.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: PollEnrich with file language

Posted by souciance <so...@gmail.com>.
I am on 2.17.0 and for the life of me cannot get it to work.

I am using this:

   .pollEnrich().simple("file:" + location +
"?fileName=${header.File}&charset=iso-8859-1&" +
           
"move=../archive/${file:name.noext}-${date:now:yyyyMMddHHmm}.${file:ext}")

All it does is create the archive folder and then it seems to ignore the
File language parts and just creates a folder with the name -<date> and puts
the filer there.



--
View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787409.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: PollEnrich with file language

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
I’ve been messing with this, and I can’t get it to behave the way you describe.  I’m running this against Camel 2.16.2

The following works for me.  Note that I remove the seconds and milliseconds from the filename to make the test a little more reliable - but it’s still vulnerable to false failures because of the potential time difference between when I create my expected filename and when the File component moves the file.

public class PollEnrichFileBuilderTest extends CamelTestSupport {
    @Override
    public boolean isUseAdviceWith() { return true; }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct://trigger")
                        .pollEnrich("file://target/data/in?move=../archive/${file:name.noext}-${date:now:yyyyMMddHHmm}.${file:ext}")
                        .to("mock://complete");
            }
        };
    }

    @Test
    public void testSingleMessage() throws Exception {
        File srcDataDir =  new File("src/data");
        String srcDataFileName = "message1";
        String srcDataFileExtension =".xml";

        NotifyBuilder complete = new NotifyBuilder(context).whenDone(1).create();

        File testSrcDir = new File("target/data/in");
        File testArchiveDir = new File("target/data/archive");
        if (testSrcDir.exists()) {
            FileUtil.removeDir(testSrcDir);
        }
        if (testArchiveDir.exists()) {
            FileUtil.removeDir(testArchiveDir);
        }

        testSrcDir.mkdirs();
        FileUtil.copyFile(new File(srcDataDir, srcDataFileName + srcDataFileExtension), new File(testSrcDir,  srcDataFileName + srcDataFileExtension));

        SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyyMMddHHmm");
        String expectedFilename = srcDataFileName + "-" + timestampFormat.format(new Date()) + srcDataFileExtension;

        context.start();

        template.sendBody("direct://trigger", "Dummy Body");

        assertTrue("Should have completed on exchange", complete.matches(10, TimeUnit.SECONDS));
        assertTrue("Test Archive directory should exist", testArchiveDir.exists());

        assertEquals("Should not have any files in source directory", 0, testSrcDir.listFiles().length);

        File[] archiveFiles = testArchiveDir.listFiles();
        assertEquals("Should only have one file in archive directory", 1, archiveFiles.length);
        assertEquals("Unexpected archive file name", archiveFiles[0].getName(), expectedFilename);
    }
}



> On Sep 8, 2016, at 1:50 PM, Quinn Stevenson <qu...@pronoia-solutions.com> wrote:
> 
> I apologize - I missed the "&move=" when I looked at this the first time.  What you have looks like it should work to me as well.
> 
> 
>> On Sep 8, 2016, at 1:45 PM, souciance <so...@gmail.com> wrote:
>> 
>> Well in that case the documentation needs to be updated because looking at:
>> https://camel.apache.org/file2.html
>> in the section *About movedFailed* that is how it is defined there as well
>> without the fileName. But I will try with the fileName just to verify.
>> Thanks.
>> 
>> 
>> 
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787386.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
> 


Re: PollEnrich with file language

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
I apologize - I missed the "&move=" when I looked at this the first time.  What you have looks like it should work to me as well.


> On Sep 8, 2016, at 1:45 PM, souciance <so...@gmail.com> wrote:
> 
> Well in that case the documentation needs to be updated because looking at:
> https://camel.apache.org/file2.html
> in the section *About movedFailed* that is how it is defined there as well
> without the fileName. But I will try with the fileName just to verify.
> Thanks.
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787386.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: PollEnrich with file language

Posted by souciance <so...@gmail.com>.
Well in that case the documentation needs to be updated because looking at:
https://camel.apache.org/file2.html
in the section *About movedFailed* that is how it is defined there as well
without the fileName. But I will try with the fileName just to verify.
Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787386.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: PollEnrich with file language

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
I think the File component is doing exactly what you asked it to :-)

The URI of the File component contains directories - not file names.  You control the file name through either the fileName URI option or the CamelFileName/CamelOverruleFileName headers.  Check out the docs for the file component for more details (http://camel.apache.org/file2.html <http://camel.apache.org/file2.html>)

To get you’re existing URI working the way you’d like, I think you could just insert ?fileName= before the simple/file expression - something like

pollEnrich("...&move=importArchive/?fileName=${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}”)


> On Sep 8, 2016, at 12:16 PM, souciance <so...@gmail.com> wrote:
> 
> Hi,
> 
> Does pollEnrich work properly with the file language?
> 
> I have written a simple statement that moves the file after polling and adds
> a timestamp to the file. However the output is that it creates a folder with
> the timestamp name and ignores the filename and file extension.
> This is my statement..
> 
> .pollEnrich("...&move=importArchive/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}")
> 
> Instead it creates a folder inside importArchive with the name based on
> -${date:now:yyyyMMddHHmmssSSS}
> 
> Best
> Souciance
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: PollEnrich with file language

Posted by souciance <so...@gmail.com>.
Thanks Hans, I will try and get back to you.



--
View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787385.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: PollEnrich with file language

Posted by Hans Orbaan <ha...@docdata.eu>.
Hi,


Can you try $simple{file:onlyname.noext}_$simple{date:now:yyyMMddHHmmssSSS}.$simple{file:name.ext}. Not sure if it will work though.


With kind regards,


Hans Orbaan


________________________________
Van: souciance <so...@gmail.com>
Verzonden: donderdag 8 september 2016 20:16
Aan: users@camel.apache.org
Onderwerp: PollEnrich with file language

Hi,

Does pollEnrich work properly with the file language?

I have written a simple statement that moves the file after polling and adds
a timestamp to the file. However the output is that it creates a folder with
the timestamp name and ignores the filename and file extension.
This is my statement..

.pollEnrich("...&move=importArchive/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}")

Instead it creates a folder inside importArchive with the name based on
-${date:now:yyyyMMddHHmmssSSS}

Best
Souciance



--
View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380.html
Camel - Users - PollEnrich with file language<http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380.html>
camel.465427.n5.nabble.com
PollEnrich with file language. Hi, Does pollEnrich work properly with the file language? I have written a simple statement that moves the file after polling and adds a timestamp to the file....



Sent from the Camel - Users mailing list archive at Nabble.com.

Re: PollEnrich with file language

Posted by souciance <so...@gmail.com>.
Nicely spotted, yeah works with constant and setting the header in an
earlier step. So I guess with pollEnrich and simple, the move parameter is
useful if you want the same filename but moved to a different folder.

On Fri, Sep 9, 2016 at 4:30 PM, Quinn Stevenson [via Camel] <
ml-node+s465427n5787423h76@n5.nabble.com> wrote:

> I messed with the sample I posted earlier, and I think I see what going on
> now -
>
> pollEnrich().simple(….) is evaluating the expression - but the “?move=“
> part doesn’t evaluate to anything meaningful at the point it’s evaluated.
> The “move=“ expressions need to be evaluated after the file has been
> picked-up, but they are being evaluated before the file is read.
>
> I changed my sample to use pollEnrich().simple(…) and I see similar
> behavior to what you describe.  However, if I use
> pollEnrich().constant(….), it works fine.
>
> The only dynamic part of the URI I see in your sample is the
> ${header.File} - you could set the CamelFileName header and remove the
> “fileName=“ part of the URI, and I think you’re example will work (with
> .constant() ).
>
> Hope that helps
>
> > On Sep 9, 2016, at 8:05 AM, souciance <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5787423&i=0>> wrote:
> >
> > I am using windows 7, camel 2.17.0.
> >
> > It works if I set the uri in a from() but in pollEnrich.simple() it
> doesn't
> > seem. Maybe something really obvious that I am missing.
> >
> > On Fri, Sep 9, 2016 at 3:54 PM, Hans Orbaan [via Camel] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5787423&i=1>
> <mailto:[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5787423&i=2>>> wrote:
> >
> >> What os are you using? Your test worked Fine on windows
> >>
> >> Op 9 sep. 2016 3:12 p.m. schreef souciance <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5787421&i=0 <ht
> tp://user/SendEmail.jtp?type=node&node=5787421&i=0>>>:
> >> The strange thing is, it does not matter what expression I use,
> anything
> >> after &move= turns into a folder. I think pollEnrich with dynamic
> >> endpoints
> >> has an issue with move.
> >>
> >> Basically this fails:
> >>
> >> pollEnrich().simple("file:" + folder +
> >> "?fileName=${header.File}&charset=iso-8859-1&move=
> >> archive/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}")
> >>
> >> It simply creates a folder with the timestamp name and ignores the File
> >> expressions.
> >>
> >> My workaround was to use a Processor and a ConsumerTemplate and send in
> >> the
> >> file URI. That worked.
> >>
> >> On Fri, Sep 9, 2016 at 11:29 AM, souciance [via Camel] <
> >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5787421&i=1 <
> http://user/SendEmail.jtp?type=node&node=5787421&i=1>>>
> >> wrote:
> >>
> >>> I am on 2.17.0 and for the life of me cannot get it to work.
> >>>
> >>> I am using this:
> >>>
> >>>   .pollEnrich().simple("file:" + location + "?fileName=${header.File}&charset=iso-8859-1&"
>
> >>
> >>> +
> >>>            "move=../archive/${file:name.noext}-${date:now:yyyyMMddHHmm}.${file:ext}")
>
> >>
> >>>
> >>>
> >>> All it does is create the archive folder and then it seems to ignore
> the
> >>> File language parts and just creates a folder with the name -<date>
> and
> >>> puts the filer there.
> >>>
> >>> ------------------------------
> >>> If you reply to this email, your message will be added to the
> discussion
> >>> below:
> >>> http://camel.465427.n5.nabble.com/PollEnrich-with-file- <htt
> p://camel.465427.n5.nabble.com/PollEnrich-with-file->
> >>> language-tp5787380p5787409.html
> >>> To start a new topic under Camel - Users, email
> >>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5787421&i=2
>  <http://user/SendEmail.jtp?type=node&node=5787421&i=2>>
> >>> To unsubscribe from PollEnrich with file language, click here
> >>> <
> >>> .
> >>> NAML
> >>> <http://camel.465427.n5.nabble.com/template/
> NamlServlet.jtp?macro=macro_
> >> viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.
>
> >> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> >> nabble.view.web.template.NodeNamespace&breadcrumbs=
> >> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
> >> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> >>>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context: http://camel.465427.n5.nabble.
> >> com/PollEnrich-with-file-language-tp5787380p5787419.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >>
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >> http://camel.465427.n5.nabble.com/PollEnrich-with-file- <htt
> p://camel.465427.n5.nabble.com/PollEnrich-with-file->
> >> language-tp5787380p5787421.html
> >> To start a new topic under Camel - Users, email
> >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5787423&i=3>
> <mailto:[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5787423&i=4>>
> >> To unsubscribe from PollEnrich with file language, click here
> >> < href="" target="_top" rel="nofollow" link="external">
> >> .
> >> NAML
> >> <http://camel.465427.n5.nabble.com/template/
> NamlServlet.jtp?macro=macro_viewer&id=instant_html%
> 21nabble%3Aemail.naml&base=nabble.naml.namespaces.
> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.view.web.template.NodeNamespace&breadcrumbs=
> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_
> viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.
> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.view.web.template.NodeNamespace&breadcrumbs=
> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>>
> >>
> >
> >
> >
> >
> > --
> > View this message in context: http://camel.465427.n5.nabble.
> com/PollEnrich-with-file-language-tp5787380p5787422.html <
> http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-
> tp5787380p5787422.html>
> > Sent from the Camel - Users mailing list archive at Nabble.com <
> http://nabble.com/>.
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/PollEnrich-with-file-
> language-tp5787380p5787423.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from PollEnrich with file language, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5787380&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NTc4NzM4MHwxNTMyOTExNjU2>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787424.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: PollEnrich with file language

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
I messed with the sample I posted earlier, and I think I see what going on now -

pollEnrich().simple(….) is evaluating the expression - but the “?move=“ part doesn’t evaluate to anything meaningful at the point it’s evaluated.  The “move=“ expressions need to be evaluated after the file has been picked-up, but they are being evaluated before the file is read.

I changed my sample to use pollEnrich().simple(…) and I see similar behavior to what you describe.  However, if I use pollEnrich().constant(….), it works fine.

The only dynamic part of the URI I see in your sample is the ${header.File} - you could set the CamelFileName header and remove the “fileName=“ part of the URI, and I think you’re example will work (with .constant() ).

Hope that helps

> On Sep 9, 2016, at 8:05 AM, souciance <so...@gmail.com> wrote:
> 
> I am using windows 7, camel 2.17.0.
> 
> It works if I set the uri in a from() but in pollEnrich.simple() it doesn't
> seem. Maybe something really obvious that I am missing.
> 
> On Fri, Sep 9, 2016 at 3:54 PM, Hans Orbaan [via Camel] <
> ml-node+s465427n5787421h14@n5.nabble.com <ma...@n5.nabble.com>> wrote:
> 
>> What os are you using? Your test worked Fine on windows
>> 
>> Op 9 sep. 2016 3:12 p.m. schreef souciance <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5787421&i=0 <http://user/SendEmail.jtp?type=node&node=5787421&i=0>>>:
>> The strange thing is, it does not matter what expression I use, anything
>> after &move= turns into a folder. I think pollEnrich with dynamic
>> endpoints
>> has an issue with move.
>> 
>> Basically this fails:
>> 
>> pollEnrich().simple("file:" + folder +
>> "?fileName=${header.File}&charset=iso-8859-1&move=
>> archive/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}")
>> 
>> It simply creates a folder with the timestamp name and ignores the File
>> expressions.
>> 
>> My workaround was to use a Processor and a ConsumerTemplate and send in
>> the
>> file URI. That worked.
>> 
>> On Fri, Sep 9, 2016 at 11:29 AM, souciance [via Camel] <
>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5787421&i=1 <http://user/SendEmail.jtp?type=node&node=5787421&i=1>>>
>> wrote:
>> 
>>> I am on 2.17.0 and for the life of me cannot get it to work.
>>> 
>>> I am using this:
>>> 
>>>   .pollEnrich().simple("file:" + location + "?fileName=${header.File}&charset=iso-8859-1&"
>> 
>>> +
>>>            "move=../archive/${file:name.noext}-${date:now:yyyyMMddHHmm}.${file:ext}")
>> 
>>> 
>>> 
>>> All it does is create the archive folder and then it seems to ignore the
>>> File language parts and just creates a folder with the name -<date> and
>>> puts the filer there.
>>> 
>>> ------------------------------
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>> http://camel.465427.n5.nabble.com/PollEnrich-with-file- <http://camel.465427.n5.nabble.com/PollEnrich-with-file->
>>> language-tp5787380p5787409.html
>>> To start a new topic under Camel - Users, email
>>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5787421&i=2 <http://user/SendEmail.jtp?type=node&node=5787421&i=2>>
>>> To unsubscribe from PollEnrich with file language, click here
>>> <
>>> .
>>> NAML
>>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_
>> viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.
>> BasicNamespace-nabble.view.web.template.NabbleNamespace-
>> nabble.view.web.template.NodeNamespace&breadcrumbs=
>> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
>> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context: http://camel.465427.n5.nabble.
>> com/PollEnrich-with-file-language-tp5787380p5787419.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> 
>> 
>> 
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://camel.465427.n5.nabble.com/PollEnrich-with-file- <http://camel.465427.n5.nabble.com/PollEnrich-with-file->
>> language-tp5787380p5787421.html
>> To start a new topic under Camel - Users, email
>> ml-node+s465427n465428h31@n5.nabble.com <ma...@n5.nabble.com>
>> To unsubscribe from PollEnrich with file language, click here
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5787380&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NTc4NzM4MHwxNTMyOTExNjU2 <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5787380&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NTc4NzM4MHwxNTMyOTExNjU2>>
>> .
>> NAML
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>>
>> 
> 
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787422.html <http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787422.html>
> Sent from the Camel - Users mailing list archive at Nabble.com <http://nabble.com/>.


Re: PollEnrich with file language

Posted by souciance <so...@gmail.com>.
I am using windows 7, camel 2.17.0.

It works if I set the uri in a from() but in pollEnrich.simple() it doesn't
seem. Maybe something really obvious that I am missing.

On Fri, Sep 9, 2016 at 3:54 PM, Hans Orbaan [via Camel] <
ml-node+s465427n5787421h14@n5.nabble.com> wrote:

> What os are you using? Your test worked Fine on windows
>
> Op 9 sep. 2016 3:12 p.m. schreef souciance <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5787421&i=0>>:
> The strange thing is, it does not matter what expression I use, anything
> after &move= turns into a folder. I think pollEnrich with dynamic
> endpoints
> has an issue with move.
>
> Basically this fails:
>
> pollEnrich().simple("file:" + folder +
> "?fileName=${header.File}&charset=iso-8859-1&move=
> archive/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}")
>
> It simply creates a folder with the timestamp name and ignores the File
> expressions.
>
> My workaround was to use a Processor and a ConsumerTemplate and send in
> the
> file URI. That worked.
>
> On Fri, Sep 9, 2016 at 11:29 AM, souciance [via Camel] <
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5787421&i=1>>
> wrote:
>
> > I am on 2.17.0 and for the life of me cannot get it to work.
> >
> > I am using this:
> >
> >    .pollEnrich().simple("file:" + location + "?fileName=${header.File}&charset=iso-8859-1&"
>
> > +
> >             "move=../archive/${file:name.noext}-${date:now:yyyyMMddHHmm}.${file:ext}")
>
> >
> >
> > All it does is create the archive folder and then it seems to ignore the
> > File language parts and just creates a folder with the name -<date> and
> > puts the filer there.
> >
> > ------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://camel.465427.n5.nabble.com/PollEnrich-with-file-
> > language-tp5787380p5787409.html
> > To start a new topic under Camel - Users, email
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5787421&i=2>
> > To unsubscribe from PollEnrich with file language, click here
> > <
> > .
> > NAML
> > <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_
> viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.
> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.view.web.template.NodeNamespace&breadcrumbs=
> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> >
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/PollEnrich-with-file-language-tp5787380p5787419.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/PollEnrich-with-file-
> language-tp5787380p5787421.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from PollEnrich with file language, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5787380&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NTc4NzM4MHwxNTMyOTExNjU2>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-tp5787380p5787422.html
Sent from the Camel - Users mailing list archive at Nabble.com.