diff options
author | 2017-11-08 14:29:21 +0000 | |
---|---|---|
committer | 2017-11-08 14:29:21 +0000 | |
commit | eeb8a8441e6267b46ff4426f6c87d1df54a03ef1 (patch) | |
tree | d617b81066bf95e0f82e98033188cdcf5cd546a3 /bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java | |
parent | e86c847eca166568dd64fc8ca9fe60812709651e (diff) | |
parent | 13728948b328e856c8892d2f6e47f076df09c757 (diff) |
Merge "modified sample SDNO code for SO"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java index 4d70a16b73..d2752c531b 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java @@ -22,29 +22,30 @@ package org.openecomp.mso.client.dmaap; import java.io.FileNotFoundException; import java.io.IOException; -import java.util.concurrent.TimeUnit; -import com.att.nsa.mr.client.MRBatchingPublisher; -import com.att.nsa.mr.client.MRClientFactory; +import org.openecomp.mso.client.dmaap.rest.RestPublisher; -public class DmaapPublisher { +public abstract class DmaapPublisher extends DmaapClient { - private final long seconds; - private final MRBatchingPublisher publisher; - - public DmaapPublisher(String filepath) throws FileNotFoundException, IOException { + private long seconds; + private final Publisher publisher; + public DmaapPublisher() throws FileNotFoundException, IOException { + super("dmaap/default-consumer.properties"); + this.publisher = new RestPublisher(properties); this.seconds = 20; - this.publisher = MRClientFactory.createBatchingPublisher(filepath); + } - public DmaapPublisher(String filepath, long seconds) throws FileNotFoundException, IOException { + public DmaapPublisher(long seconds) throws FileNotFoundException, IOException { + this(); this.seconds = seconds; - this.publisher = MRClientFactory.createBatchingPublisher(filepath); } public void send(String json) throws IOException, InterruptedException { + auditLogger.info("publishing message to dmaap topic " + this.getTopic() + ": " + json); publisher.send(json); - publisher.close(seconds, TimeUnit.SECONDS); + //publisher.close(seconds, TimeUnit.SECONDS); } + } |