|
@@ -1,8 +1,8 @@
|
|
|
package com.qmth.themis.backend.start;
|
|
|
|
|
|
-import com.qmth.themis.backend.config.RocketImConsumer;
|
|
|
import com.qmth.themis.business.entity.TEExamStudent;
|
|
|
import com.qmth.themis.business.service.TEExamStudentService;
|
|
|
+import com.qmth.themis.mq.listener.RocketMessageConsumer;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -11,6 +11,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
+import java.util.StringJoiner;
|
|
|
|
|
|
/**
|
|
|
* @Description: 服务启动时初始化运行,哪个微服务模块需要则拿此模版去用
|
|
@@ -27,7 +28,7 @@ public class StartRunning implements CommandLineRunner {
|
|
|
TEExamStudentService teExamStudentService;
|
|
|
|
|
|
@Resource
|
|
|
- RocketImConsumer rocketImConsumer;
|
|
|
+ RocketMessageConsumer rocketMessageConsumer;
|
|
|
|
|
|
@Value("${rocketmq.name-server}")
|
|
|
String nameSrvAddr;
|
|
@@ -36,10 +37,12 @@ public class StartRunning implements CommandLineRunner {
|
|
|
public void run(String... args) throws Exception {
|
|
|
log.info("服务器启动时执行 start");
|
|
|
List<TEExamStudent> teExamStudentList = teExamStudentService.list();
|
|
|
+ StringJoiner stringJoiner = new StringJoiner("");
|
|
|
teExamStudentList.forEach(s -> {
|
|
|
- rocketImConsumer.setRocketMQConsumer(nameSrvAddr, String.valueOf(s.getId()) + "group", "imTopic", "teacher || user");
|
|
|
+ rocketMessageConsumer.setRocketMQConsumer(nameSrvAddr, String.valueOf(s.getId()) + "group", "imTopic", "teacher");
|
|
|
// rocketImConsumer.setRocketMQConsumer(nameSrvAddr, "imGroup", "imTopic", "teacher || user");
|
|
|
});
|
|
|
+// rocketImConsumer.setRocketMQConsumer(nameSrvAddr, "imGroup", "imTopic", "teacher");
|
|
|
log.info("服务器启动时执行 end");
|
|
|
}
|
|
|
}
|