Join metrics publishing thread when shutting factory down.
This commit is contained in:
parent
6d3ffff870
commit
f4849baa42
1 changed files with 6 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ package com.amazonaws.services.kinesis.metrics.impl;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import com.amazonaws.AbortedException;
|
||||
import com.amazonaws.ClientConfiguration;
|
||||
import com.amazonaws.auth.AWSCredentialsProvider;
|
||||
import com.amazonaws.services.cloudwatch.AmazonCloudWatch;
|
||||
|
|
@ -142,6 +143,11 @@ public class CWMetricsFactory implements IMetricsFactory {
|
|||
|
||||
public void shutdown() {
|
||||
runnable.shutdown();
|
||||
try {
|
||||
publicationThread.join();
|
||||
} catch (InterruptedException e) {
|
||||
throw new AbortedException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue