|  |  | 
 |  |  | import com.dy.common.mw.protocol4Mqtt.MqttPubMsg; | 
 |  |  | import com.dy.common.queue.NodeObj; | 
 |  |  | import com.dy.rtuMw.server.ServerProperties; | 
 |  |  | import com.dy.rtuMw.server.forTcp.RtuLogDealer; | 
 |  |  | import org.apache.logging.log4j.LogManager; | 
 |  |  | import org.apache.logging.log4j.Logger; | 
 |  |  | import org.eclipse.paho.client.mqttv3.MqttClient; | 
 |  |  | 
 |  |  |         }else{ | 
 |  |  |             if(mqttClient != null && mqttClient.isConnected()){ | 
 |  |  |                 try { | 
 |  |  |                     mqttManager.publishMsg(mqttClient, this.result.topic, this.result.msg); | 
 |  |  |                     mqttManager.publishMsg(mqttClient, this.result.topic.longName(), this.result.msg); | 
 |  |  |                     DevStatusDealer.afterSendPubMessage(this.result.deviceId); | 
 |  |  |                     RtuLogDealer.log4Mqtt(this.result.deviceId, "发布消息    主题:" + this.result.topic + "   消息:" + this.result.msg); | 
 |  |  |                     log.info("发布MQTT消息(主题=" + this.result.topic + ")" + this.result.msg); | 
 |  |  |                 }catch (Exception e){ | 
 |  |  |                     log.error("MQTT发布消息失败(主题=" + this.result.topic + ")" , e); | 
 |  |  |                 }finally { | 
 |  |  |                     mqttManager.pushMqttClient(mqttClient); | 
 |  |  |                 } | 
 |  |  |                 return false ; | 
 |  |  |                 if(this.result.hasResponse){ | 
 |  |  |                     return false ; | 
 |  |  |                 }else{ | 
 |  |  |                     return true ; | 
 |  |  |                 } | 
 |  |  |             }else{ | 
 |  |  |                 //未曾连接MQTT服务器 | 
 |  |  |                 return this.decideRemoveNodeFromCach(now) ; |