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 <souciance.eqdam.ras...@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+s465427n5787421...@n5.nabble.com 
> <mailto:ml-node+s465427n5787421...@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+s465427n465428...@n5.nabble.com 
>> <mailto:ml-node+s465427n465428...@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/>.

Reply via email to