Browse Source

修改redis键

tianboguang 2 years ago
parent
commit
2b62534c5b

+ 2 - 1
src/main/java/com/fdkankan/modeling/constants/SysConstants.java

@@ -36,7 +36,8 @@ public class SysConstants implements ApplicationContextAware {
 
     public static final String SYSTEM_PREFIX = "model-center";
 
-    public static final String SCENE_BUILDING = SYSTEM_PREFIX+":scene:building:";
+    public static final String SCENE_BUILDING = SYSTEM_PREFIX+":scene:building:num:";
+    public static final String SCENE_MESSAGE_BUILDING = SYSTEM_PREFIX+":scene:building:message:";
 
     public static ExecutorService executorService = Executors.newFixedThreadPool(1);
 

+ 1 - 1
src/main/java/com/fdkankan/modeling/receiver/RabbitMqListener.java

@@ -270,7 +270,7 @@ public class RabbitMqListener {
 
         if(!ObjectUtils.isEmpty(buildLog.getMessageId())){
             // 设置消息id幂等性,防止消息重复消费
-            boolean lock = redisLockUtil.lock(SysConstants.SCENE_BUILDING + buildLog.getMessageId(), SysConstants.modelTimeOut * 3600);
+            boolean lock = redisLockUtil.lock(SysConstants.SCENE_MESSAGE_BUILDING + buildLog.getMessageId(), SysConstants.modelTimeOut * 3600);
             if (!lock) {
                 log.error("服务:{},消息重复消费:{}", SysConstants.hostName, buildLog.getMessageId());
                 throw new BuildException(ModelingBuildStatus.REPEAT);