ppalaga commented on a change in pull request #228: Cleanup
URL: https://github.com/apache/camel-quarkus/pull/228#discussion_r331759366
 
 

 ##########
 File path: 
extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
 ##########
 @@ -58,29 +60,25 @@ void beans(BuildProducer<AdditionalBeanBuildItem> 
beanProducer) {
         @BuildStep
         CamelRegistryBuildItem registry(
             CamelRecorder recorder,
+            RecorderContext recorderContext,
             ApplicationArchivesBuildItem applicationArchives,
             List<CamelBeanBuildItem> registryItems) {
 
             RuntimeValue<Registry> registry = recorder.createRegistry();
 
-            CamelSupport.services(applicationArchives).filter(
-                si -> registryItems.stream().noneMatch(
-                    c -> Objects.equals(si.name, c.getName()) && 
c.getType().isAssignableFrom(si.type)
-                )
-            ).forEach(
-                si -> {
-                    LOGGER.debug("Binding camel service {} with type {}", 
si.name, si.type);
+            CamelSupport.services(applicationArchives).forEach(si -> {
+                    LOGGER.debug("Binding bean with name: {}, type {}", 
si.name, si.type);
 
                     recorder.bind(
                         registry,
                         si.name,
-                        si.type
+                        recorderContext.classProxy(si.type)
 
 Review comment:
   As far as I could understand, `RecorderContext.classProxy(String)` postpones 
the class loading to runtime. Do some things break for us without using the 
classProxy? In other words, I wonder why is this better than passing the class 
name and do Class.forName() in the recorder that we had before? 
   
   Maybe we need this because it postpones not only the class loading but also 
the class initialization?

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


With regards,
Apache Git Services

Reply via email to