Do not start application context automatically
- This will avoid other lifecycle beans inside the application context starting when binding lifecycle beans are started. Resolves #525 Address review comments
This commit is contained in:
committed by
Soby Chacko
parent
0756b998bd
commit
ebc508ee61
@@ -386,7 +386,6 @@ public class SendingBean {
|
||||
}
|
||||
}
|
||||
----
|
||||
|
||||
==== Producing and Consuming Messages
|
||||
|
||||
You can write a Spring Cloud Stream application using either Spring Integration annotations or Spring Cloud Stream's `@StreamListener` annotation.
|
||||
|
||||
@@ -62,7 +62,6 @@ public class OutputBindingLifecycle implements SmartLifecycle, ApplicationContex
|
||||
"Cannot perform binding, no proper implementation found", e);
|
||||
}
|
||||
this.running = true;
|
||||
this.applicationContext.start();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* @author Marius Bogoevici
|
||||
* @author Ilayaperumal Gopinathan
|
||||
*/
|
||||
public class LifecycleBinderTests {
|
||||
|
||||
@@ -39,9 +40,8 @@ public class LifecycleBinderTests {
|
||||
public void testNonSmartLifecyclesStarted() {
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(TestSource.class, "--server.port=-1");
|
||||
SimpleLifecycle simpleLifecycle = applicationContext.getBean(SimpleLifecycle.class);
|
||||
assertThat(simpleLifecycle.isRunning());
|
||||
applicationContext.close();
|
||||
assertThat(simpleLifecycle.isRunning()).isFalse();
|
||||
applicationContext.close();
|
||||
}
|
||||
|
||||
@EnableBinding(Source.class)
|
||||
|
||||
Reference in New Issue
Block a user