level = Level.valueOf(name);
}
String serviceName = exchange.getIn().getHeader(SERVICE_NAME, exchange.getContext().getName(), String.class);
String hostName = exchange.getIn().getHeader(HOST_NAME, "localhost", String.class);
MessagePayload payload = new MessagePayload(hostName, level.ordinal(), serviceName, message);
if (log.isDebugEnabled()) {
log.debug("Sending notification to Nagios: {}", payload.getMessage());
}
sender.send(payload);