INT-2485 Orderly Shutdown
Initial commit - @ManagedOperation on IMBE - can be invoked via JMX, <control-bus/>, or getting a reference to the IMBE from the application context. INT-2485 Updates After Review Comments (JIRA) * Shutdown Schedulers first, and wait for them * Add a force parameter, which overrides thread pool shutdown options * Shutdown Sources/Channels after all thread pools have stopped * Mark other components as OrderlyShutdownCapable (e.g. JMS/AMQP Listener containers) and shut them down first * Wait for remaining time to allow for quiescence Also * remove TimeUnit parameter (not JMX-friendly); time limit is now always milliseconds * If thread pools don't stop in time limit, force them down. INT-2485 Handle Self-Destruction Add shutdown-executor to IMBE. When the shutdown was called on a Spring-Managed thread, the shutdown was not clean because we timed out waiting for the current thread to terminate. After that, we force terminated other components. Now, by providing a dedicated Executor for the shutdown process, it is used for the shutdown instead of the current thread. This Executor is *not* shutdown. It is not necessary to provide an Executor if the stopActiveComponents() method is called on some other thread that is not involved in the shutdown. Also adds executor name to logs, when available. INT-2485 Polishing Fix MBean object name collision when running all tests. INT-2485 Enable TCP Shutdown Make TCP connection factories 'OrderlyShutdownCapable' so they are stopped before schedulers/executors in order for them to release any executor threads they are holding. INT-2485 Polishing Didn't need DirectFieldAccessor - scheduler and executor have an accessor for the native ExecutorService. Copyrights INT-2485 Polishing schemaLocation version. INT-2485 PR Review Polishing
This commit is contained in:
committed by
Oleg Zhurakousky
parent
77e3886a12
commit
0a12a496cc
@@ -40,6 +40,7 @@ import org.springframework.core.serializer.Deserializer;
|
||||
import org.springframework.core.serializer.Serializer;
|
||||
import org.springframework.integration.MessagingException;
|
||||
import org.springframework.integration.context.IntegrationObjectSupport;
|
||||
import org.springframework.integration.core.OrderlyShutdownCapable;
|
||||
import org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -51,7 +52,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractConnectionFactory extends IntegrationObjectSupport
|
||||
implements ConnectionFactory, Runnable, SmartLifecycle {
|
||||
implements ConnectionFactory, Runnable, SmartLifecycle, OrderlyShutdownCapable {
|
||||
|
||||
protected static final int DEFAULT_REPLY_TIMEOUT = 10000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user