fix memory leak for vescollector 81/22781/1 1.0.0-Amsterdam 1.0.0-ONAP v1.1.0 v1.1.4
authorVijay <vv770d@att.com>
Wed, 8 Nov 2017 13:12:26 +0000 (13:12 +0000)
committerVijay <vv770d@att.com>
Wed, 8 Nov 2017 13:12:48 +0000 (13:12 +0000)
Issue-ID: DCAEGEN2-198
Change-Id: I09296ae4d13a0ad442bc139e69c13d19e4be0916
Signed-off-by: Vijay <vv770d@att.com>
src/main/java/org/onap/dcae/commonFunction/EventPublisher.java

index 0d9cf91..d76299d 100644 (file)
@@ -148,7 +148,7 @@ public class EventPublisher {
                 log.info("Pending Message Count=" + pendingMsgs);
             }
 
-            //closePublisher();
+            closePublisher();
             log.info("pub.send invoked - no error");
             CommonStartup.oplog.info(String.format("URL:%sTOPIC:%sEvent Published:%s",
                 ueburl, topic, event));
@@ -156,6 +156,9 @@ public class EventPublisher {
         } catch (IOException | GeneralSecurityException | IllegalArgumentException e) {
             log.error("Unable to publish event: {} streamid: {}. Exception: {}", event, streamid, e);
         }
+       finally {
+                       closePublisher();
+       }
 
     }