import java.io.IOException;
import java.util.Properties;
-import javax.annotation.PostConstruct;
import org.onap.dmaap.mr.client.MRClientFactory;
import org.onap.dmaap.mr.client.MRConsumer;
import org.onap.dmaap.mr.client.response.MRConsumerResponse;
@Scheduled(fixedRate = 1000 * 10) // , initialDelay=60000)
@Override
public void run() {
- /*
- * if (!alive) { init(); }
- */
+ if (!alive) {
+ init();
+ }
if (this.alive) {
try {
Iterable<String> dmaapMsgs = fetchAllMessages();
return response.getActualMessages();
}
- @PostConstruct
+ // Properties are not loaded in first atempt. Need to fix this and then uncomment the post construct annotation
+ // @PostConstruct
@Override
public void init() {
Properties dmaapConsumerProperties = applicationConfig.getDmaapConsumerConfig();
}
try {
logger.debug("Creating DMAAP Client");
+ System.out.println("dmaapConsumerProperties--->"+dmaapConsumerProperties.getProperty("topic"));
+ System.out.println("dmaapPublisherProperties--->"+dmaapPublisherProperties.getProperty("topic"));
consumer = MRClientFactory.createConsumer(dmaapConsumerProperties);
this.alive = true;
} catch (IOException e) {