Commit e2156808 authored by caotao's avatar caotao

1.增加异步注解处理消息处理过多问题处理。

parent 53498788
......@@ -20,6 +20,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
......@@ -68,6 +69,7 @@ public class CarIotNewListener extends EmqxListener {
public static final ConcurrentHashMap<String, String> deviceLastInfo = new ConcurrentHashMap();
@Override
@Async
public void processMessage(String topic, MqttMessage message) throws Exception {
logger.info("----收到物联消息::topic---------------" + topic);
......
......@@ -42,7 +42,7 @@ import java.net.UnknownHostException;
@ComponentScan(value = {"org.typroject", "com.yeejoin.amos", "com.yeejoin.equipmanage"}, excludeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler.class})})
@EnableFeignClients
@EnableAsync
@EnableAsync(proxyTargetClass = true)
public class AmostEquipApplication {
private static final Logger logger = LoggerFactory.getLogger(AmostEquipApplication.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment