Commit dc9fc30c authored by 赵啸非's avatar 赵啸非

修改redis 过期事件通知

parent 513ea6e1
...@@ -10,6 +10,7 @@ import org.checkerframework.checker.units.qual.A; ...@@ -10,6 +10,7 @@ import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.Message; import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener; import org.springframework.data.redis.connection.MessageListener;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.mortals.framework.springcloud.service.IApplicationService; import com.mortals.framework.springcloud.service.IApplicationService;
...@@ -22,17 +23,10 @@ public class DeviceStartService implements IApplicationService { ...@@ -22,17 +23,10 @@ public class DeviceStartService implements IApplicationService {
@Autowired @Autowired
private SendTaskThreadPool sendTaskThreadPool; private SendTaskThreadPool sendTaskThreadPool;
@Autowired
private ICacheService cacheService;
@Override @Override
public void start() { public void start() {
log.info("初始化发送线程数量"); log.info("初始化发送线程数量");
sendTaskThreadPool.init(20); sendTaskThreadPool.init(20);
log.info("初始化过期key监听事件");
for(int i=0;i<100;i++){
cacheService.setnx("test-expire"+i,"111", 10+i);
}
log.info("开始服务..[配置已加载完成,但部分框架还未初始化,比如:Kafka]"); log.info("开始服务..[配置已加载完成,但部分框架还未初始化,比如:Kafka]");
} }
......
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