ppalaga commented on a change in pull request #358: Fix #136 @ConfigProperty
and @Inject do not work in RouteBuilders
URL: https://github.com/apache/camel-quarkus/pull/358#discussion_r344901192
##########
File path:
extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
##########
@@ -249,17 +262,55 @@ CamelRuntimeRegistryBuildItem bindRuntimeBeansToRegistry(
* disabled by setting quarkus.camel.disable-main = true
*/
public static class Main {
+
+ @BuildStep
+ public List<CamelRoutesBuilderClassBuildItem>
discoverRoutesBuilderClassNames(
+ CombinedIndexBuildItem combinedIndex) {
+ final IndexView index = combinedIndex.getIndex();
+ Set<ClassInfo> allKnownImplementors = new HashSet<>();
+ allKnownImplementors.addAll(
+
index.getAllKnownImplementors(DotName.createSimple(RoutesBuilder.class.getName())));
+ allKnownImplementors.addAll(
+
index.getAllKnownSubclasses(DotName.createSimple(RouteBuilder.class.getName())));
+ allKnownImplementors.addAll(
+
index.getAllKnownSubclasses(DotName.createSimple(AdviceWithRouteBuilder.class.getName())));
+
+ return allKnownImplementors
+ .stream()
+ // public and non-abstract
+ .filter(ci -> ((ci.flags() & (Modifier.ABSTRACT |
Modifier.PUBLIC)) == Modifier.PUBLIC))
+ .map(ClassInfo::name)
+ .map(CamelRoutesBuilderClassBuildItem::new)
+ .collect(Collectors.toList());
+ }
+
@Record(ExecutionTime.STATIC_INIT)
@BuildStep
- public List<CamelRoutesBuilderBuildItem> collectRoutes(
- CombinedIndexBuildItem combinedIndex,
+ public List<CamelBeanBuildItem> collectRoutes(
+ List<CamelRoutesBuilderClassBuildItem> camelRoutesBuilders,
Review comment:
np
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services