Fix aggregated application behavior

* After moving some bunch of beans from the `@EnableBinding` to the
auto-configuration for proper conditional lifecycle we need to be sure
that all those support beans are registered for each child context as
it was before after parsing imports on the `@EnableBinding`.
This way add `search = SearchStrategy.CURRENT` for all the conditions
in the `BindingServiceConfiguration`
* Fix `TestSupportBinderConfiguration` to rely only on the `Binder`
instance created once in the parent level.
This way when we use an aggregated application, only the parent context
creates for us a `TestSupportBinder` and all the child contexts reuse it.
* Register `BinderFactory` only once in parent ctx
This commit is contained in:
Artem Bilan
2018-08-09 16:34:16 -04:00
committed by Soby Chacko
parent ae445e73ac
commit 776fe5da77
3 changed files with 8 additions and 3 deletions

View File

@@ -16,6 +16,7 @@
package org.springframework.cloud.stream.test.binder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.stream.binder.Binder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -32,6 +33,7 @@ import org.springframework.messaging.MessageChannel;
* @author Marius Bogoevici
*/
@Configuration
@ConditionalOnMissingBean(Binder.class)
public class TestSupportBinderConfiguration {
private Binder<MessageChannel, ?, ?> messageChannelBinder = new TestSupportBinder();