| | |
| | | import com.fzzy.api.data.PushProtocol; |
| | | import com.fzzy.api.utils.ContextUtil; |
| | | import com.fzzy.api.view.repository.ApiLogRep; |
| | | import com.fzzy.data.ConfigData; |
| | | import com.fzzy.gateway.GatewayUtils; |
| | | import com.fzzy.gateway.api.GatewayRemoteService; |
| | | import com.fzzy.gateway.data.BaseResp; |
| | |
| | | private GatewayConfService gatewayConfService; |
| | | @Resource |
| | | private KafkaDeviceReportService kafkaDeviceReportService; |
| | | @Resource |
| | | private ConfigData configData; |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | String messageInfo = JSONObject.toJSONString(heartBeatData); |
| | | |
| | | kafkaDeviceReportService.publishWithTopic(messageInfo, topic); |
| | | //如果是测试模式不执行推送 |
| | | if (configData.getActive().indexOf("dev") >= 0) { |
| | | |
| | | log.info("----------------------------推送KAFKA信息,注:调试模式不推送---------------------------"); |
| | | log.info("-----TOPIC-----{}", topic); |
| | | log.info("-----Message-----{}", messageInfo); |
| | | |
| | | return; |
| | | } |
| | | |
| | | |
| | | kafkaDeviceReportService.publishWithTopic(messageInfo, topic); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("------网关心跳接口--执行失败-----{}", e); |
| | |
| | | } |
| | | |
| | | messageInfo = JSONObject.toJSONString(statusData); |
| | | |
| | | //如果是测试模式不执行推送 |
| | | if (configData.getActive().indexOf("dev") >= 0) { |
| | | |
| | | log.info("----------------------------推送KAFKA信息,注:调试模式不推送---------------------------"); |
| | | log.info("-----TOPIC-----{}", topic); |
| | | log.info("-----Message-----{}", messageInfo); |
| | | |
| | | return; |
| | | } |
| | | |
| | | //推送设备状态 |
| | | kafkaDeviceReportService.publishWithTopic(messageInfo, topic); |
| | | |