Not enforcing EnableAutoConfiguration on aggregate parent

- The aggregate parent configuration now imports the required auto configuration classes such as ChannelBindingAutoConfiguration and EndpointAutoConfiguration
while `@EnableBinding` is still at the parent configuration to be able to share the binding configuration among the child applications
 - Add `ConditionalOnMissingBean` in spring cloud stream auto configuration classes so that if `EnableAutoConfiguration` is enabled at child application classes
they don't get instantiated again
 - Conditionally import EmbeddedServlet auto-configuration when web environment is enabled for parent
 - Add test

Resolves #737
This commit is contained in:
Ilayaperumal Gopinathan
2017-02-15 17:01:43 +05:30
committed by Janne Valkealahti
parent 2df9f9b4ee
commit 8792423abc
7 changed files with 64 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,6 +51,7 @@ public class KryoCodecAutoConfiguration {
KryoCodecProperties kryoCodecProperties;
@Bean
@ConditionalOnMissingBean(PojoCodec.class)
public PojoCodec codec() {
Map<String, KryoRegistrar> kryoRegistrarMap = applicationContext.getBeansOfType(KryoRegistrar
.class);
@@ -58,6 +59,7 @@ public class KryoCodecAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean(KryoRegistrar.class)
public KryoRegistrar fileRegistrar() {
return new FileKryoRegistrar();
}