use of org.openkilda.messaging.Destination in project open-kilda by telstra.
the class RecordHandler method doControllerMsg.
protected void doControllerMsg(CommandMessage message) {
// Define the destination topic where the reply will be sent to.
final String replyToTopic;
if (message instanceof CommandWithReplyToMessage) {
replyToTopic = ((CommandWithReplyToMessage) message).getReplyTo();
} else {
replyToTopic = OUTPUT_FLOW_TOPIC;
}
final Destination replyDestination = getDestinationForTopic(replyToTopic);
try {
CommandData data = message.getData();
handleCommand(message, data, replyToTopic, replyDestination);
} catch (FlowCommandException e) {
ErrorMessage error = new ErrorMessage(e.makeErrorResponse(), System.currentTimeMillis(), message.getCorrelationId(), replyDestination);
context.getKafkaProducer().postMessage(replyToTopic, error);
} catch (Exception e) {
logger.error("Unhandled exception: {}", e);
}
}
Aggregations