GH-61: Use shutdown for executors in KinesisMDCA
Fixes: spring-projects/spring-integration-aws#61 With the `shutdownNow()` the currently ran task are marked with the `Thread.interrupt()`. The AWS SDK catch this situation and throws `AbortedException` * To let currently ran task finish properly switch from the `shutdownNow()` to the `shutdown()` for internal executors The external Spring-based executors (`ExecutorConfigurationSupport`) must be supplied with the `waitForTasksToCompleteOnShutdown` option
This commit is contained in:
@@ -252,10 +252,10 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport i
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
if (!this.consumerExecutorExplicitlySet) {
|
||||
((ExecutorService) this.consumerExecutor).shutdownNow();
|
||||
((ExecutorService) this.consumerExecutor).shutdown();
|
||||
}
|
||||
if (!this.dispatcherExecutorExplicitlySet) {
|
||||
((ExecutorService) this.dispatcherExecutor).shutdownNow();
|
||||
((ExecutorService) this.dispatcherExecutor).shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user