Я пытаюсь выяснить, почему мое приложение весенней загрузки останавливается, учитывая код:
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
@Configuration
@EnableIntegration
public class FirestoreCommandIntegrationFlow {
@Bean
public StandardIntegrationFlow registerInboundAdapter() {
return IntegrationFlows.from("input")
.transform("hello"::equals)
.handle(m -> System.err.println("work"))
.get();
}
}
Что я пытаюсь выяснить, так это то, почему приложение просто останавливается без каких-либо ошибок, запускается нормально, а затем через несколько секунд просто отбрасывает подписку на «входной» канал и закрывает поток.
Я знаю, что это, вероятно, глупый вопрос, но я просто не могу найти причину, по которой приложение останавливается. Я следил за https://github.com/spring-projects/spring-integration-java-dsl/wiki/Spring-Integration-Java-DSL-Reference и, как я понял, мой поток должен продолжать слушать канал «ввода», а поток должен продолжать работать.
ПРИМЕЧАНИЕ. У моего приложения springboot отключен веб-сервер с spring.main.web-environment=false
в application.properties
Вход:
2019-01-09 13:32:21.261 INFO 12658 --- [ main] c.r.t.m.Application : Starting Application on ...
2019-01-09 13:32:21.265 INFO 12658 --- [ main] c.r.t.m.Application : No active profile set, falling back to default profiles: default
2019-01-09 13:32:21.348 INFO 12658 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@625732: startup date [Wed Jan 09 13:32:21 CET 2019]; root of context hierarchy
2019-01-09 13:32:21.744 INFO 12658 --- [ main] o.s.i.c.IntegrationRegistrar : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2019-01-09 13:32:22.025 INFO 12658 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2019-01-09 13:32:22.030 INFO 12658 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2019-01-09 13:32:22.199 INFO 12658 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$b59005e8] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-01-09 13:32:22.446 INFO 12658 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'taskScheduler'
2019-01-09 13:32:22.854 INFO 12658 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2019-01-09 13:32:22.863 INFO 12658 --- [ main] o.s.c.s.DefaultLifecycleProcessor : Starting beans in phase 0
2019-01-09 13:32:22.863 INFO 12658 --- [ main] o.s.i.e.EventDrivenConsumer : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2019-01-09 13:32:22.863 INFO 12658 --- [ main] o.s.i.c.PublishSubscribeChannel : Channel 'application.errorChannel' has 1 subscriber(s).
2019-01-09 13:32:22.864 INFO 12658 --- [ main] o.s.i.e.EventDrivenConsumer : started _org.springframework.integration.errorLogger
2019-01-09 13:32:22.864 INFO 12658 --- [ main] o.s.i.e.EventDrivenConsumer : Adding {transformer} as a subscriber to the 'input' channel
2019-01-09 13:32:22.864 INFO 12658 --- [ main] o.s.i.c.DirectChannel : Channel 'application.input' has 1 subscriber(s).
2019-01-09 13:32:22.864 INFO 12658 --- [ main] o.s.i.e.EventDrivenConsumer : started org.springframework.integration.config.ConsumerEndpointFactoryBean#0
2019-01-09 13:32:22.872 INFO 12658 --- [ main] c.r.t.m.Application : Started Application in 2.032 seconds (JVM running for 2.652)
2019-01-09 13:32:22.874 INFO 12658 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@625732: startup date [Wed Jan 09 13:32:21 CET 2019]; root of context hierarchy
2019-01-09 13:32:22.876 INFO 12658 --- [ Thread-2] o.s.c.s.DefaultLifecycleProcessor : Stopping beans in phase 0
2019-01-09 13:32:22.877 INFO 12658 --- [ Thread-2] o.s.i.e.EventDrivenConsumer : Removing {transformer} as a subscriber to the 'input' channel
2019-01-09 13:32:22.877 INFO 12658 --- [ Thread-2] o.s.i.c.DirectChannel : Channel 'application.input' has 0 subscriber(s).
2019-01-09 13:32:22.877 INFO 12658 --- [ Thread-2] o.s.i.e.EventDrivenConsumer : stopped org.springframework.integration.config.ConsumerEndpointFactoryBean#0
2019-01-09 13:32:22.877 INFO 12658 --- [ Thread-2] o.s.i.e.EventDrivenConsumer : Removing {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2019-01-09 13:32:22.877 INFO 12658 --- [ Thread-2] o.s.i.c.PublishSubscribeChannel : Channel 'application.errorChannel' has 0 subscriber(s).
2019-01-09 13:32:22.877 INFO 12658 --- [ Thread-2] o.s.i.e.EventDrivenConsumer : stopped _org.springframework.integration.errorLogger
2019-01-09 13:32:22.878 INFO 12658 --- [ Thread-2] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2019-01-09 13:32:22.878 INFO 12658 --- [ Thread-2] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler'
Process finished with exit code 0