private static final Logger logger = LoggerFactory.getLogger(DmaapMessageHandler.class);
+ private boolean initialize = false;
@Autowired
private ObjectMapper mapper;
@Autowired
// The publish properties is corrupted. It contains the subscribe property values.
@Async("threadPoolTaskExecutor")
public void handleDmaapMsg(String msg) {
- logger.debug("Message ---------->{}", msg);
- init();
+ if (!initialize) {
+ init();
+ }
DmaapRequestMessage dmaapRequestMessage = null;
Optional<String> dmaapResponse = null;
// Process the message
topic = dmaapPublisherConfig.getProperty("topic");
logger.debug("Read the topic & Service Name - {} , {}", host, topic);
this.restClient = new AsyncRestClient("http://" + host + "/"); // get this value from application config
+ initialize = true;
}
}