diff --git a/src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java b/src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java index 18f88ae..663e9d5 100644 --- a/src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java +++ b/src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java @@ -19,7 +19,7 @@ import java.util.concurrent.atomic.AtomicInteger; @Component public class IotMessageListener implements MessageListener { - private AtomicInteger count = new AtomicInteger(0); + private volatile AtomicInteger count = new AtomicInteger(0); /** * Runnable:实现了Runnable接口,jdk就知道这个类是一个线程 */