fix: 加入异步注解配置后redis消费者不能正常消费

This commit is contained in:
zy 2022-11-18 09:51:19 +08:00
parent 969b9c3458
commit 9b667448ea

View File

@ -78,7 +78,6 @@ public class YudaoMQAutoConfiguration {
* Redis Stream xreadgroup 命令https://www.geek-book.com/src/docs/redis/redis/redis.io/commands/xreadgroup.html * Redis Stream xreadgroup 命令https://www.geek-book.com/src/docs/redis/redis/redis.io/commands/xreadgroup.html
*/ */
@Bean(initMethod = "start", destroyMethod = "stop") @Bean(initMethod = "start", destroyMethod = "stop")
@Async // 异步化可降低 5 秒左右的启动时间
public StreamMessageListenerContainer<String, ObjectRecord<String, String>> redisStreamMessageListenerContainer( public StreamMessageListenerContainer<String, ObjectRecord<String, String>> redisStreamMessageListenerContainer(
RedisMQTemplate redisMQTemplate, List<AbstractStreamMessageListener<?>> listeners) { RedisMQTemplate redisMQTemplate, List<AbstractStreamMessageListener<?>> listeners) {
RedisTemplate<String, ?> redisTemplate = redisMQTemplate.getRedisTemplate(); RedisTemplate<String, ?> redisTemplate = redisMQTemplate.getRedisTemplate();