CAMEL-23370 fix camel.main.routes-include-pattern usage with multi-level wildcard matchers in springboot jars#22788
Conversation
…level wildcard matchers in springboot jars Using `classpath:**/*.xml` (like any xml in any dir) was broken since _probably_ CAMEL-21944
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
|
|
Hi @vilmosnagy thanks for the fix. You can add a test in the camel-spring-boot repository, for example, similar to the following one https://github.com/apache/camel-spring-boot/blob/4bdea8a87e75c67d0a242752264f42646ea8551b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelXmlRoutesTest.java#L35 |
|
Hi @Croway, thanks for the direction! I've added a test in my fork: My understanding is that this bug is only triggered when Camel is run via From debugging, it seems that when running with Surefire, The only way I was able to reproduce the faulty behavior was:
Interestingly, my JetBrains IDE seems to use a different classloading approach and still loads these resources directly from the filesystem rather than from the JAR, so the issue does not appear there. If you have a better idea for reproducing this, please let me know. Also, |
|
yeah its not easy to test and the idea of building a -jar as another maven module is correct. I wonder if the test can be moved into the |
|
@davsclaus I almost have the test done: do you have any example on how can I set a custom |
|
I am not sure how you run the test, though the regular unit tests for SB allow to declare custom values for its But feel free to provide what you have and we can take a look to help last bit. But we dont have a release in a hurry so there is plenty of time to get this done over the following weeks |
|
I hope this is the test you were thinking of: apache/camel-spring-boot#1773 At first, I tried to write a test similar to the existing ones in the I wasn’t able to write a similar test for loading XML routes from another module, because the In the end, I moved my previous attempt to the I’m not fully happy with this solution, but I don’t see a better alternative at the moment. This still applies from my previous comment:
|
|
I reviewed apache/camel-spring-boot#1773 . I think that we can merge it, and have the tests merged later. Thanks for your contributions @vilmosnagy |
|
ok |
Using
classpath:**/*.xml(like any xml in any dir) was broken since probably CAMEL-21944 & #17716Description
See CAMEL-23370; but it seems to me that multi-level include-route matchers are broken since #17716.
This worked with Camel 4.11:
and does not work with latest snapshot.
I'm not sure how to write tests for my use-case though; and not sure if it ain't broke anything, 'cause there seem to bit not much tests around this part of the codebase.
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.