1 package org.openecomp.mso.client.dmaap;
3 import java.io.FileNotFoundException;
4 import java.io.IOException;
5 import java.util.concurrent.TimeUnit;
7 import com.att.nsa.mr.client.MRBatchingPublisher;
8 import com.att.nsa.mr.client.MRClientFactory;
10 public class DmaapPublisher {
12 private final long seconds;
13 private final MRBatchingPublisher publisher;
15 public DmaapPublisher(String filepath) throws FileNotFoundException, IOException {
17 this.publisher = MRClientFactory.createBatchingPublisher(filepath);
20 public DmaapPublisher(String filepath, long seconds) throws FileNotFoundException, IOException {
21 this.seconds = seconds;
22 this.publisher = MRClientFactory.createBatchingPublisher(filepath);
25 public void send(String json) throws IOException, InterruptedException {
27 publisher.close(seconds, TimeUnit.SECONDS);