summaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-dmaap-adapter
diff options
context:
space:
mode:
authorJegadeesh Babu <jegabab1@in.ibm.com>2019-03-01 19:28:38 +0530
committerTakamune Cho <takamune.cho@att.com>2019-03-01 14:49:14 +0000
commit37a3bbf542f8e5cd07338855b9ac3a90eb5f124e (patch)
tree385251a42986ccf8f6fa1dfa8f986fd66f85800c /appc-adapters/appc-dmaap-adapter
parent5d185ed733c897df1e5d51285b5941a780fe6520 (diff)
Handled interrupted exception sonar fix
Sonar fix Issue-ID: APPC-1517 Change-Id: I0a9fb64812c84963b08a53b09358f598d96eb014 Signed-off-by: Jegadeesh Babu <jegabab1@in.ibm.com>
Diffstat (limited to 'appc-adapters/appc-dmaap-adapter')
-rw-r--r--appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java
index 409dbebf3..efff18ed9 100644
--- a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java
+++ b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/impl/DmaapProducerImpl.java
@@ -6,6 +6,8 @@
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
+ * Modifications Copyright (C) 2019 IBM
+ * =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -186,11 +188,14 @@ public class DmaapProducerImpl implements Producer {
}
LOG.debug("Closing Dmaap producer clients....");
for (MRBatchingPublisher client : clients) {
- try {
- client.close(1, TimeUnit.SECONDS);
- } catch (IOException | InterruptedException e) {
- LOG.warn(String.format("Failed to cleanly close Dmaap connection for [%s]", client), e);
- }
+ try {
+ client.close(1, TimeUnit.SECONDS);
+ } catch (InterruptedException e) {
+ LOG.warn(String.format("Failed to cleanly close Dmaap connection for [%s]", client), e);
+ Thread.currentThread().interrupt();
+ } catch (IOException e) {
+ LOG.warn(String.format("Failed to cleanly close Dmaap connection for [%s]", client), e);
+ }
}
}