You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "lburgazzoli (via GitHub)" <gi...@apache.org> on 2024/02/29 12:30:20 UTC

[PR] feat: add initial support for camel-k [camel-spring-boot]

lburgazzoli opened a new pull request, #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097

   (no comment)


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508642462


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   I think I can do something similar with bean post processors but this context customizer does not look too bad
   
   Let me know if you think I should rather explore bean post processors of it this looks ok-ish



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508649146


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   That method does lookup various beans and configure them. I would think `CamelContextCustomizer` should be there instead.
   
   Also if you think to make it cleaner, we can add a new method on `DefaultConfigurationConfigurer` just for these customizers, and invoke it after the method above. And then you also need to remember to call this method from Camel Spring Boot (and the same for Quarkus unless it does some special magic for this)
   
   
   



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#issuecomment-1976686609

   ok so now failures are because there is no yet a -SNAPSHOT ready 


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508638758


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   Yeah its something you added, and its not much in use. In camel-core we use it for yaml-dsl but then its internally handled there, and not something that requires camel to trigger on startup.
   
   I am look at that mapstruct thing now ... curious why its there



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508646772


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   I would likely try to change this in camel-core via
   
           // lookup and configure SPI beans
           DefaultConfigurationConfigurer.afterConfigure(camelContext);
           
           



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1511402167


##########
core/camel-spring-boot-xml/src/main/java/org/apache/camel/spring/boot/xml/SpringBootXmlCamelContextConfigurer.java:
##########
@@ -47,6 +45,8 @@ public void configure(ApplicationContext applicationContext, SpringCamelContext
             // spring boot is not capable at this phase to use an injector that is creating beans
             // via spring-boot itself, so use a default injector instead
             camelContext.setInjector(new DefaultInjector(camelContext));
+
+            // TODO: not sure how this works TBH

Review Comment:
   done



##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -95,11 +95,14 @@ public class CamelAutoConfiguration {
     @ConditionalOnMissingBean(CamelContext.class)
     CamelContext camelContext(ApplicationContext applicationContext,
                               CamelConfigurationProperties config,
-                              CamelBeanPostProcessor beanPostProcessor) throws Exception {
+                              CamelBeanPostProcessor beanPostProcessor,
+                              List<CamelContextCustomizer> contextCustomizers) throws Exception {

Review Comment:
   done



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1511013049


##########
core/camel-spring-boot-xml/src/main/java/org/apache/camel/spring/boot/xml/SpringBootXmlCamelContextConfigurer.java:
##########
@@ -47,7 +49,9 @@ public void configure(ApplicationContext applicationContext, SpringCamelContext
             // spring boot is not capable at this phase to use an injector that is creating beans
             // via spring-boot itself, so use a default injector instead
             camelContext.setInjector(new DefaultInjector(camelContext));
-            CamelAutoConfiguration.doConfigureCamelContext(applicationContext, camelContext, config);
+
+            // TODO: not sure how this works TBH
+            CamelAutoConfiguration.doConfigureCamelContext(applicationContext, camelContext, List.of(), config);

Review Comment:
   not needed anymore (https://github.com/apache/camel/pull/13376)



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1511012570


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   moved to camel-main: https://github.com/apache/camel/pull/13376



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#issuecomment-1976589949

   Ah sorry its those darn test copy from core, that have little value and get out of date


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1511302250


##########
core/camel-spring-boot-xml/src/main/java/org/apache/camel/spring/boot/xml/SpringBootXmlCamelContextConfigurer.java:
##########
@@ -47,6 +45,8 @@ public void configure(ApplicationContext applicationContext, SpringCamelContext
             // spring boot is not capable at this phase to use an injector that is creating beans
             // via spring-boot itself, so use a default injector instead
             camelContext.setInjector(new DefaultInjector(camelContext));
+
+            // TODO: not sure how this works TBH

Review Comment:
   I think this file can be reverted



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1507505050


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   @davsclaus I added this to avoid polluting this `camelContext` method, I'm not sure if there is a better way of doing it. 
   
   Note that there is a [MapstructMappingAutoConfiguration]( https://github.com/apache/camel-spring-boot/blob/main/components-starter/camel-mapstruct-starter/src/main/java/org/apache/camel/component/mapstruct/springboot/MapstructMappingAutoConfiguration.java) that produces a bean of type `CamelContextCustomizer` but I haven't found any reference of where customizers are used in `camel-spring-boot`



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508649398


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   Otherwise then I think the rest is good



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1507505050


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   @davsclaus I added this to avoid polluting this `camelContext` method, I'm not sure if there is a better way of doing 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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508827045


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   ok, so I'll try to move to camel-main, the only thing I have to check is on camel-quarkus as it is heavily used



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1511013365


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -95,19 +99,23 @@ public class CamelAutoConfiguration {
     @ConditionalOnMissingBean(CamelContext.class)
     CamelContext camelContext(ApplicationContext applicationContext,
                               CamelConfigurationProperties config,
-                              CamelBeanPostProcessor beanPostProcessor) throws Exception {
+                              CamelBeanPostProcessor beanPostProcessor,
+                              List<CamelContextCustomizer> contextCustomizers) throws Exception {
+
         CamelContext camelContext = new SpringBootCamelContext(applicationContext, config.isWarnOnEarlyShutdown());
         // bean post processor is created before CamelContext
         beanPostProcessor.setCamelContext(camelContext);
         camelContext.getCamelContextExtension().addContextPlugin(CamelBeanPostProcessor.class, beanPostProcessor);
-        return doConfigureCamelContext(applicationContext, camelContext, config);
+
+        return doConfigureCamelContext(applicationContext, camelContext, contextCustomizers, config);
     }
 
     /**
      * Not to be used by Camel end users
      */
     public static CamelContext doConfigureCamelContext(ApplicationContext applicationContext,
                                                 CamelContext camelContext,
+                                                List<CamelContextCustomizer> contextCustomizers,

Review Comment:
   Not needed anymore (moved to camel-main: https://github.com/apache/camel/pull/13376)



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1511301812


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -95,11 +95,14 @@ public class CamelAutoConfiguration {
     @ConditionalOnMissingBean(CamelContext.class)
     CamelContext camelContext(ApplicationContext applicationContext,
                               CamelConfigurationProperties config,
-                              CamelBeanPostProcessor beanPostProcessor) throws Exception {
+                              CamelBeanPostProcessor beanPostProcessor,
+                              List<CamelContextCustomizer> contextCustomizers) throws Exception {

Review Comment:
   This is no longer needed



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#issuecomment-1976782101

   There was some leftover in the camel-spring-boot core module. If this gets reverted then this PR is only adding a new camel-k module, and then its perfect fine to merged.


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508650701


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -95,19 +99,23 @@ public class CamelAutoConfiguration {
     @ConditionalOnMissingBean(CamelContext.class)
     CamelContext camelContext(ApplicationContext applicationContext,
                               CamelConfigurationProperties config,
-                              CamelBeanPostProcessor beanPostProcessor) throws Exception {
+                              CamelBeanPostProcessor beanPostProcessor,
+                              List<CamelContextCustomizer> contextCustomizers) throws Exception {
+
         CamelContext camelContext = new SpringBootCamelContext(applicationContext, config.isWarnOnEarlyShutdown());
         // bean post processor is created before CamelContext
         beanPostProcessor.setCamelContext(camelContext);
         camelContext.getCamelContextExtension().addContextPlugin(CamelBeanPostProcessor.class, beanPostProcessor);
-        return doConfigureCamelContext(applicationContext, camelContext, config);
+
+        return doConfigureCamelContext(applicationContext, camelContext, contextCustomizers, config);
     }
 
     /**
      * Not to be used by Camel end users
      */
     public static CamelContext doConfigureCamelContext(ApplicationContext applicationContext,
                                                 CamelContext camelContext,
+                                                List<CamelContextCustomizer> contextCustomizers,

Review Comment:
   This can then be removed if we make camel-core do the customizer itself, as then it will just lookup them from the registry like all the other beans it does today (same same)



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508650168


##########
core/camel-spring-boot-xml/src/main/java/org/apache/camel/spring/boot/xml/SpringBootXmlCamelContextConfigurer.java:
##########
@@ -47,7 +49,9 @@ public void configure(ApplicationContext applicationContext, SpringCamelContext
             // spring boot is not capable at this phase to use an injector that is creating beans
             // via spring-boot itself, so use a default injector instead
             camelContext.setInjector(new DefaultInjector(camelContext));
-            CamelAutoConfiguration.doConfigureCamelContext(applicationContext, camelContext, config);
+
+            // TODO: not sure how this works TBH
+            CamelAutoConfiguration.doConfigureCamelContext(applicationContext, camelContext, List.of(), config);

Review Comment:
   Yeah this is for old legacy Spring XML with embedded `<camelContext>` in Spring `<beans>` XML files. that you run inside spring boot.



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#issuecomment-1976570366

   Looks like there are some issues related to openapi v2 rmeoval
   
   ```
   [INFO] Running org.apache.camel.openapi.RestOpenApiReaderTest
   [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.058 s <<< FAILURE! -- in org.apache.camel.openapi.RestOpenApiReaderTest
   [ERROR] org.apache.camel.openapi.RestOpenApiReaderTest.testReaderRead -- Time elapsed: 0.010 s <<< ERROR!
   java.lang.IllegalArgumentException: OpenAPI 2.x is not supported
   	at org.apache.camel.openapi.RestOpenApiReader.checkCompatOpenApi2(RestOpenApiReader.java:182)
   	at org.apache.camel.openapi.RestOpenApiReader.read(RestOpenApiReader.java:176)
   	at org.apache.camel.openapi.RestOpenApiReaderTest.testReaderRead(RestOpenApiReaderTest.java:105)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
   	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
   	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
   ```


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#issuecomment-1976589846

   > Are you on old code ?
   
   No, rebased on main, I see that OpenApi v2 is hardcoded in some of the tests https://github.com/apache/camel-spring-boot/blob/main/components-starter/camel-openapi-java-starter/src/test/java/org/apache/camel/openapi/RestOpenApiModelApiSecurityRequirementsTest.java#L94


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#issuecomment-1976582513

   Are you on old code ?


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#issuecomment-1976596363

   fixing this now


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#issuecomment-1976601318

   pushed fix


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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508641940


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   Ah okay so its a bit of cheating so spring calls this method but return an empty noop bean.
   
   Maybe the method could return Object and a null value, or something. Or there is some spring boot annotation magic to call the method always.



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: add initial support for camel-k [camel-spring-boot]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #1097:
URL: https://github.com/apache/camel-spring-boot/pull/1097#discussion_r1508642687


##########
core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java:
##########
@@ -189,6 +197,12 @@ public static CamelContext doConfigureCamelContext(ApplicationContext applicatio
         // and call after all properties are set
         DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
 
+        // apply custom configurations if any
+        // TODO: this must be evaluated as I don't know if it makes sense here.
+        contextCustomizers.stream()
+                .sorted(Comparator.comparing(CamelContextCustomizer::getOrder))
+                .forEach(c -> c.configure(camelContext));

Review Comment:
   But this makes us wonder, should we make `CamelContextCustomizer` a general thing and let it be part of camel-core (camel-main) during bootstrap so it checks if there are custom in the registy and call them on starutp



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

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org