diff --git a/im-commom/src/main/java/com/bx/imcommon/mq/RedisMQPullTask.java b/im-commom/src/main/java/com/bx/imcommon/mq/RedisMQPullTask.java index cf5bf99..45b73b7 100644 --- a/im-commom/src/main/java/com/bx/imcommon/mq/RedisMQPullTask.java +++ b/im-commom/src/main/java/com/bx/imcommon/mq/RedisMQPullTask.java @@ -42,7 +42,7 @@ public class RedisMQPullTask implements CommandLineRunner { consumers.forEach((consumer -> { // 注解参数 RedisMQListener annotation = consumer.getClass().getAnnotation(RedisMQListener.class); - String key = consumer.generateKey(); + String queue = annotation.queue(); int batchSize = annotation.batchSize(); int period = annotation.period(); // 获取泛型类型 @@ -54,6 +54,7 @@ public class RedisMQPullTask implements CommandLineRunner { List datas = new LinkedList<>(); try { if(consumer.isReady()){ + String key = consumer.generateKey(); // 拉取一个批次的数据 List objects = pullBatch(key, batchSize); for (Object obj : objects) { @@ -69,7 +70,7 @@ public class RedisMQPullTask implements CommandLineRunner { } } } catch (Exception e) { - log.error("数据消费异常,队列:{}", key, e); + log.error("数据消费异常,队列:{}", queue, e); } // 继续消费数据 if (!EXECUTOR_SERVICE.isShutdown()) { @@ -90,7 +91,7 @@ public class RedisMQPullTask implements CommandLineRunner { List objects = new LinkedList<>(); if (redisMQTemplate.isSupportBatchPull()) { // 版本大于6.2,支持批量拉取 - objects = redisMQTemplate.opsForList().leftPop(key, 100); + objects = redisMQTemplate.opsForList().leftPop(key, batchSize); } else { // 版本小于6.2,只能逐条拉取 Object obj = redisMQTemplate.opsForList().leftPop(key); diff --git a/im-ui/src/components/friend/FriendItem.vue b/im-ui/src/components/friend/FriendItem.vue index 1e86fe0..5be5222 100644 --- a/im-ui/src/components/friend/FriendItem.vue +++ b/im-ui/src/components/friend/FriendItem.vue @@ -59,7 +59,7 @@ }, onSelectMenu(item) { this.$emit(item.key.toLowerCase(), this.msgInfo); - } + } }, computed:{ friend(){ @@ -78,6 +78,7 @@ default: true } } + } diff --git a/im-uniapp/App.vue b/im-uniapp/App.vue index 432ec85..2891dfd 100644 --- a/im-uniapp/App.vue +++ b/im-uniapp/App.vue @@ -351,8 +351,9 @@