sonar critical for errorhandling 61/39561/1
authorDushyant Singh Thakur <dt00503496@techmahindra.com>
Wed, 28 Mar 2018 09:49:38 +0000 (15:19 +0530)
committerDushyant Singh Thakur <dt00503496@techmahindra.com>
Wed, 28 Mar 2018 09:49:38 +0000 (15:19 +0530)
Either re-interrupt this method or rethrow the InterruptedException
Sonar Link:
https://sonar.onap.org/project/issues?id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AV4-Vagy32hFUzlqc5s0&resolved=false&severities=CRITICAL&types=BUG
Location:
src/main/java/com/att/nsa/cambria/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java
Line No-192

Change-Id: I5cdf566045392cb5845067565c50660b2afed333
Issue-ID: DMAAP-307
Signed-off-by: Dushyant Singh Thakur <dt00503496@techmahindra.com>
src/main/java/com/att/nsa/cambria/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java

index 052cc78..d7e6816 100644 (file)
@@ -190,7 +190,8 @@ public class DMaaPCambriaSimplerBatchPublisher extends CambriaBaseClient
                                                + "Consider using CambriaBatchingPublisher.close( long timeout, TimeUnit timeoutUnits ) to recapture unsent messages on close.");
                        }
                } catch (InterruptedException e) {
-                       getLog().warn("Possible message loss. " + e.getMessage(), e);
+                       getLog().info(" Interruption Exception is caught here : " + e.getMessage());
+                       Thread.currentThread().interrupt();
                } catch (IOException e) {
                        getLog().warn("Possible message loss. " + e.getMessage(), e);
                }