adeelmahmood
adeelmahmood

Reputation: 2431

graceful shutdown of spring integration flow

I understand from spring integration monitoring sample https://github.com/spring-projects/spring-integration-samples/tree/master/intermediate/monitoring how control bus can be used to shutdown an integration flow. I was wondering how is

@integrationMBeanExporter.stopActiveComponents(false, 20000)

different from just shutting down application context

applicationContext.stop()

in which the flow is loaded. Will that not achieve the same result.

Upvotes: 3

Views: 2503

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121177

Actually you are right. From big hight they do the same with components: call Lifecycle.stop().

The difference that your application continue to work in first case and you can invoke Lifecycle.start() again. And IntegrationMBeanExporter does it only for integration components.

The applicationContext.stop() fully shutdown Spring Application context - in most cases just stop entire application.

Upvotes: 2

Related Questions