use of com.fanxb.bookmark.common.annotation.MqConsumer in project bookmark by FleyX.
the class MqConfiguration method run.
@Override
public void run(ApplicationArguments args) {
Map<String, Object> map = context.getBeansWithAnnotation(MqConsumer.class);
map.values().forEach(item -> {
if (!(item instanceof RedisConsumer)) {
log.warn("注意检测到被@EsConsumer注解的类{}未实现RedisConsumer接口", item.getClass().getCanonicalName());
return;
}
MqConsumer[] annotations = item.getClass().getAnnotationsByType(MqConsumer.class);
MqConsumer annotation = annotations[0];
topicMap.computeIfAbsent(annotation.value(), k -> new ArrayList<>()).add((RedisConsumer) item);
});
log.info("redis订阅信息汇总完毕!!!!!!");
// 由一个线程始终循环获取es队列数据
threadPoolExecutor.execute(loop());
}
Aggregations