|
@@ -53,7 +53,8 @@ public class MqttServiceImpl implements MqttService {
|
|
|
MqttMessage mqttMessage = new MqttMessage();
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
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);
|
|
|
try {
|
|
|
mqttAsyncClient.publish("LightSpot_recognize",mqttMessage);
|