use of com.creditease.uav.messaging.api.Message in project uavstack by uavorg.
the class NotificationEventPublishHandler method handle.
@Override
public void handle(List<NotificationEvent> data) {
MessageProducer producer = (MessageProducer) this.getComponentResource("messageproducer", "MessageProducerResourceComponent");
String notifyKey = MonitorDataFrame.MessageType.Notification.toString();
Message msg = MessagingFactory.createMessage(notifyKey);
String stream = toJSONString(data);
msg.setParam(notifyKey, stream);
boolean check = producer.submit(msg);
String sendState = notifyKey + " Data Sent " + (check ? "SUCCESS" : "FAIL");
if (log.isTraceEnable()) {
log.info(this, sendState + " " + stream);
}
}
Aggregations