MQTT消费
This commit is contained in:
parent
2e03d0780c
commit
84b0106cc7
@ -23,11 +23,11 @@ public class CommonApiImpl implements CommonApi {
|
||||
try {
|
||||
String str = JSON.toJSONString(obj);
|
||||
mqttUtils.pub(topic, JSON.toJSONString(obj));
|
||||
if (str.length() > 510) {
|
||||
/*if (str.length() > 510) {
|
||||
log.info("MQTT消息发送成功topic :{}, 内容 :{}",topic, str.substring(0, 500));
|
||||
}else {
|
||||
log.info("MQTT消息发送成功topic :{}, 内容 :{}",topic, str);
|
||||
}
|
||||
}*/
|
||||
} catch (MqttException e) {
|
||||
log.info("MQTT消息发送异常 :{}",e);
|
||||
}
|
||||
@ -37,11 +37,11 @@ public class CommonApiImpl implements CommonApi {
|
||||
public void commonMethodStr(String str, String topic) {
|
||||
try {
|
||||
mqttUtils.pub(topic, str);
|
||||
if (str.length() > 510) {
|
||||
/*if (str.length() > 510) {
|
||||
log.info("MQTT消息发送成功topic :{}, 内容 :{}",topic, str.substring(0, 500));
|
||||
}else {
|
||||
log.info("MQTT消息发送成功topic :{}, 内容 :{}",topic, str);
|
||||
}
|
||||
}*/
|
||||
} catch (MqttException e) {
|
||||
log.info("MQTT消息发送异常 :{}",e);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public class RobotStatusServiceImpl implements MqttService {
|
||||
*/
|
||||
@Override
|
||||
public void analysisMessage(String message) {
|
||||
log.info("处理RobotStatusServiceImpl的消息 :{}", message);
|
||||
// log.info("处理RobotStatusServiceImpl的消息 :{}", message);
|
||||
RobotPoseStatusDTO robotStatusData = JSON.parseObject(message, RobotPoseStatusDTO.class);
|
||||
robotStatusApi.robotStatusUpdate(robotStatusData);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class RobotStatusApiImpl implements RobotStatusApi {
|
||||
@Resource
|
||||
private RequestProcessor processor;
|
||||
|
||||
private static final ExecutorService executorService = Executors.newFixedThreadPool(20);
|
||||
private static final ExecutorService executorService = Executors.newFixedThreadPool(50);
|
||||
|
||||
@Resource
|
||||
private CommonApi commonApi;
|
||||
|
Loading…
Reference in New Issue
Block a user