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

CamelContext auto-configuration should be conditional

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.15.2
    • 2.16.0
    • camel-spring-boot
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: