[Solved] XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-13 Thread John F. Berry
Thank you Claus for your help..I got it running!  package org.mainegeneral.camel; import org.apache.camel.Processor; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; public class MyRouteBuilder extends RouteBuilder {     public void configure() {    

Re: XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-13 Thread John F. Berry
So I execute and all I get is this... it just sits here: camel.MainApp.main()] FileEndpoint   INFO  Endpoint is configured with noop=true so forcing endpoint to be idempotent as well camel.MainApp.main()] FileEndpoint   INFO  Using default memory based idempotent

Re: XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-13 Thread John F. Berry
OK.. I currently have it configured to read in the XML, pull the contained second filename, log it, but send it to a bean for it to process both file moves.  When I execute.. I don't even get the first log statements package org.mainegeneral.camel; import org.apache.camel.Processor;

Re: XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-13 Thread Claus Ibsen
Hi If you in the first route just solves to move files to another folder, when you have both of them (eg the pairs you talked a bit about). The 2nd route can then process these files, knowing that both of them are available. Camel does have support for "done files" but they are based on a

Re: XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-13 Thread John F. Berry
Yes.. this was my thinking, but with either scenario, I need to comingle exchanges to know what the first route is reading to make the decision in the second route.. In the previous e-mail you suggested I can extract the xpath in another java instance outside the route.. but I need that to

Re: XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-13 Thread Claus Ibsen
Hi An alternative is maybe to use 2 routes, where the first route checks if that 2nd file exists with a and then move the files to another folder, where the 2nd route pickup and process that file, knowing that the other file exists. On Thu, Dec 13, 2018 at 3:20 PM Claus Ibsen wrote: > > Hi > >

Re: XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-13 Thread Claus Ibsen
Hi You can use a bit of Java code to read the file content into memory, and then use xpath to extract that other file name. Camel has some helper APIs for that in IOHelper#loadTexxt and XPathBuilder. Here is some snippet from an unit test @Test public void testNotUsingExchangeResultType()

Re: XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-13 Thread John F. Berry
Thank you Claus.. it's great to hear from you again.. I did see an example close to this on stackoverflow.. someone referenced a bean as a filter to check for an extra file to exist, but in that example the extra file's name that needed to exist was static.The "chicken or the egg" question

Re: XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-12 Thread Claus Ibsen
Hi Just use Java - You can use Java File API to check for the existence of a file ;) You can also use a file filter to only pickup the file where you check for the existence of that other file. You can then write a bit of Java code as the filter and configure it on the file endpoint. In the

Re: XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-12 Thread John F. Berry
OK.. not hearing any pre-build advise.. I started building. I can successfully extract the XML field value that is the name of the work file out of the consumed file of the route. What I need to do is only move both (the file I'm consuming and it's work file).. if the work file shows up..

XML file contains filename to be moved (with itself).. what packages should I use?

2018-12-10 Thread John F. Berry
Figured I'd try something new and ask for advice here first before hitting a brick wall and asking after I hit that dead end...I need to poll for XML files dumping into a specific NFS directory, read in the XML, find the "work" file generated by the task that generated the XML, and move both