Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8801

CamelContext auto-configuration should be conditional

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.15.2
    • Fix Version/s: 2.16.0
    • Component/s: camel-spring-boot
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      The @Bean declaration of CamelContext within CamelAutoConfiguration should be made conditional to allow the user to create it manually if they so desire. This is useful when converting an application using an existing XML-based camelContext, for example.

      This would also make camel-spring-boot more consistent with Spring Boot's policy of non-invasive auto-configuration.

      The fix is just to add a conditional annotation on the camelContext method, e.g.:

          @Bean
          @ConditionalOnMissingBean(CamelContext.class)
          CamelContext camelContext(ApplicationContext applicationContext,
                                    CamelConfigurationProperties configurationProperties) {
      

        Attachments

          Activity

            People

            • Assignee:
              hekonsek Henryk Konsek
              Reporter:
              pimlottc Chris Pimlott
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: