|
@@ -53,7 +53,8 @@ public class MqttServiceImpl implements MqttService {
|
|
MqttMessage mqttMessage = new MqttMessage();
|
|
MqttMessage mqttMessage = new MqttMessage();
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("data", messageBos);
|
|
map.put("data", messageBos);
|
|
- byte[] bytes = OBJECT_MAPPER.writeValueAsBytes(map);
|
|
|
|
|
|
+ String mStr = OBJECT_MAPPER.writeValueAsString(map);
|
|
|
|
+ byte[] bytes = mStr.getBytes(StandardCharsets.UTF_8);
|
|
mqttMessage.setPayload(bytes);
|
|
mqttMessage.setPayload(bytes);
|
|
try {
|
|
try {
|
|
mqttAsyncClient.publish("LightSpot_recognize",mqttMessage);
|
|
mqttAsyncClient.publish("LightSpot_recognize",mqttMessage);
|