ppalaga commented on a change in pull request #618: Fix #Build time 
FactoryFinders
URL: https://github.com/apache/camel-quarkus/pull/618#discussion_r367831653
 
 

 ##########
 File path: 
extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
 ##########
 @@ -128,9 +130,40 @@ void 
coreServiceFilter(BuildProducer<CamelServiceFilterBuildItem> filterBuildIte
         }
 
         @BuildStep
-        void 
serviceInfoTransformers(BuildProducer<CamelServiceInfoTransformerBuildItem> 
mapperBuildItems) {
-            mapperBuildItems.produce(
-                    new 
CamelServiceInfoTransformerBuildItem(CamelServiceInfoTransformers::configurer));
+        void coreServices(
+                ApplicationArchivesBuildItem archives,
+                BuildProducer<CamelServiceBuildItem> services) {
+
+            /* Registered only */
+            CamelSupport.propertyFiles(
+                    archives,
+                    "META-INF/services/org/apache/camel/component",
+                    "META-INF/services/org/apache/camel/language",
+                    "META-INF/services/org/apache/camel/dataformat")
+                    .filter(entry -> entry.getValue().getProperty("class") != 
null)
+                    .map(entry -> 
CamelServiceBuildItem.registeredOnly(entry.getKey(), 
entry.getValue().getProperty("class")))
+                    .forEach(services::produce);
+
+            /* Configurers need some name transformation */
+            CamelSupport.propertyFiles(
+                    archives,
+                    "META-INF/services/org/apache/camel/configurer")
+                    .filter(entry -> entry.getValue().getProperty("class") != 
null)
+                    .map(entry -> CamelServiceBuildItem.registeredOnly(
 
 Review comment:
   > the registry for components and bind related configurers through a 
recorder during STATIC_INIT
   
   Yes, that would be easy to do. But when a user adds a second instance of a 
component under a different name at runtime, our configurer setting code would 
not catch it.

----------------------------------------------------------------
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