Hi, thanks but this
main.configure().withRoutesIncludePattern("file:deploy/customer/PRIVATE/EXCHANGE/*.yaml");
doesn't work saying "java.nio.file.NoSuchFileException:
deploy/customer/PRIVATE/EXCHANGE"
Like I've said previously, without the double asterisks, it does work
_without_ the "file:" prefix:
main.configure().withRoutesIncludePattern("deploy/customer/PRIVATE/EXCHANGE/*.yaml");
The above works but catches only one route.
However, I actually need to catch this pattern, with double asterisks:
main.configure().withRoutesIncludePattern("file:deploy/**/PRIVATE/EXCHANGE/*.yaml");
This fails with "java.nio.file.NoSuchFileException: deploy"
My routes are located at
deploy/customer/PRIVATE/EXCHANGE/cust.yaml
deploy/register/bank/PRIVATE/EXCHANGE/reg.yaml
and there be more routes in such a folder structure with the variable
middle part. Actual file locations are:
/home/fedd/NetBeansProjects/camelmaintry/src/main/resources/deploy/customer/PRIVATE/EXCHANGE/cust.yaml
/home/fedd/NetBeansProjects/camelmaintry/src/main/resources/deploy/register/bank/PRIVATE/EXCHANGE/reg.yaml
and in the generated target:
/home/fedd/NetBeansProjects/camelmaintry/target/classes/deploy/customer/PRIVATE/EXCHANGE/cust.yaml
/home/fedd/NetBeansProjects/camelmaintry/target/classes/deploy/register/bank/PRIVATE/EXCHANGE/reg.yaml
Netbeans uses the following command to run the program:
cd /home/fedd/NetBeansProjects/camelmaintry;
JAVA_HOME=/home/fedd/Programs/graalvm-ce-java19-22.3.0
/snap/netbeans/76/netbeans/java/maven/bin/mvn -Dexec.vmArgs=
"-Dexec.args=${exec.vmArgs} -classpath %classpath ${exec.mainClass}
${exec.appArgs}" -Dexec.appArgs=
-Dexec.mainClass=camelmaintry.CamelMainTry
-Dexec.executable=/home/fedd/Programs/graalvm-ce-java19-22.3.0/bin/java
org.codehaus.mojo:exec-maven-plugin:3.1.0:exec
(nothing special in the "exec.mainClass" and other placeholders there)
I can't grasp how to make it look into this pattern:
deploy/**/PRIVATE/EXCHANGE/*.yaml
Thanks!
--fedd
On 17.05.2023 20:15, Claus Ibsen wrote:
Hi
Okay for file system, you should favour prefixing with file:
main.configure().withRoutesIncludePattern("file:deploy/customer/PRIVATE/EXCHANGE/*.yaml");
On Wed, May 17, 2023 at 3:53 PM Fyodor Kravchenko <feddkr...@hotmail.com>
wrote:
Hi,
I'm trying to load the routes from the file system directly, it's Camel
3.20.4, and it's java 19 from the GraalVM distribution running on Ubuntu
22.04. The fact it sees the file when no wildcard is present tells me
that I'm missing something in the wildcards and the docs.
Thank you!
--fedd
(sorry for the late response, only now I've got the rejection
notification for the html-formatted email)
On 15.05.2023 11:01, Claus Ibsen wrote:
Hi
Are you loading these files from classpath or file system directly.
And what Camel version do you use
On Sun, May 14, 2023 at 5:39 PM Fyodor Kravchenko <feddkr...@hotmail.com
wrote:
Hello,
in my little test I'm trying the following,
public class CamelMainTry {
public static void main(String[] args) throws Exception {
Main main = new Main();
// this works but I need to catch more
//
main.configure().withRoutesIncludePattern("deploy/customer/PRIVATE/EXCHANGE/*.yaml");
// these don't work:'
//
main.configure().withRoutesIncludePattern("deploy/**/PRIVATE/EXCHANGE/*.yaml");
main.configure().withRoutesIncludePattern("deploy/*/PRIVATE/EXCHANGE/*.yaml");
main.run();
}
}
my files are located:
deploy/customer/PRIVATE/EXCHANGE/cust.yaml
deploy/register/bank/PRIVATE/EXCHANGE/reg.yaml
So there could be more directories in the middle; however it doesn't
substitute even one.
The Ant-style (or what I'm thinking the Ant style) pattern doesn't seem
to catch multiple directories. If I specify the directory explicitly it
works, but I need it to locate the routes in dozens of directories.
How do I fix it?
(While we're at it I would also like to make it reload on the fly for
the testing purposes, not all of the .yaml files but restricting it to
my directory structure)
Thanks!
--fedd