You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2019/12/03 10:55:23 UTC

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #501: Filter out beans from CDI from build time discovery

ppalaga commented on a change in pull request #501: Filter out beans from CDI from build time discovery
URL: https://github.com/apache/camel-quarkus/pull/501#discussion_r353110114
 
 

 ##########
 File path: extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
 ##########
 @@ -153,12 +151,15 @@ CamelRegistryBuildItem registry(
                 CamelRecorder recorder,
                 RecorderContext recorderContext,
                 ApplicationArchivesBuildItem applicationArchives,
+                BeanRegistrationPhaseBuildItem beanRegistrationPhase,
                 List<CamelBeanBuildItem> registryItems,
                 List<CamelServiceFilterBuildItem> serviceFilters) {
 
-            RuntimeValue<Registry> registry = recorder.createRegistry();
+            final RuntimeValue<Registry> registry = recorder.createRegistry();
+            final List<BeanInfo> beans = beanRegistrationPhase.getContext().get(BuildExtension.Key.BEANS);
 
             CamelSupport.services(applicationArchives)
+                    .filter(si -> !CamelSupport.isContainerBean(beans, si))
 
 Review comment:
   Here and on other places where CamelSupport.isContainerBean is invoked, I have concerns about the algo complexity. Now it is `m*n` (container beans x camel beans) in the worst case. To improve it, we could perhaps transform the container beans into a set of `CamelBeanInfo`s and store the set inside a BuildItem so that we can re-use it on all three call sites without needing to iterate over the list of container beans for every camel bean. WDYT?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services