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+s465427n5787423...@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+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>
> .
> 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.

Reply via email to