use of org.openkilda.messaging.info.discovery.HealthCheckInfoData in project open-kilda by telstra.
the class KafkaHealthCheckMessageConsumer method receive.
/**
* Receives messages from WorkFlowManager queue.
*
* @param record the message object instance
*/
@KafkaListener(id = "northbound-listener-health-check", topics = Topic.HEALTH_CHECK)
public void receive(final String record) {
try {
logger.trace("message received");
Message message = MAPPER.readValue(record, Message.class);
if (Destination.NORTHBOUND.equals(message.getDestination())) {
logger.debug("message received: {}", record);
InfoMessage info = (InfoMessage) message;
HealthCheckInfoData healthCheck = (HealthCheckInfoData) info.getData();
messages.put(healthCheck.getId(), healthCheck);
} else {
logger.trace("Skip message: {}", message);
}
} catch (IOException exception) {
logger.error("Could not deserialize message: {}", record, exception);
}
}
Aggregations