[
https://issues.apache.org/jira/browse/CAMEL-8801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14565652#comment-14565652
]
ASF GitHub Bot commented on CAMEL-8801:
---------------------------------------
GitHub user pimlottc opened a pull request:
https://github.com/apache/camel/pull/532
CAMEL-8801 Make spring-boot auto-configuration defer to existing beans
Only instantiate a CamelContext bean if one does not already exist. Same
with ConsumerTemplate and ProducerTemplate.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/pimlottc/camel master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/532.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #532
----
commit 89da35368e75f7b18172444a79b5bb2067b9f36c
Author: Chris Pimlott <[email protected]>
Date: 2015-05-26T19:10:27Z
CAMEL-8801 Make spring-boot auto-configuration defer to existing beans
----
> CamelContext auto-configuration should be conditional
> -----------------------------------------------------
>
> Key: CAMEL-8801
> URL: https://issues.apache.org/jira/browse/CAMEL-8801
> Project: Camel
> Issue Type: Improvement
> Components: camel-spring-boot
> Affects Versions: 2.15.2
> Reporter: Chris Pimlott
>
> 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|http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-replacing-auto-configuration].
> The fix is just to add a conditional annotation on the camelContext method,
> e.g.:
> {code}
> @Bean
> @ConditionalOnMissingBean(CamelContext.class)
> CamelContext camelContext(ApplicationContext applicationContext,
> CamelConfigurationProperties
> configurationProperties) {
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)