[Bug] RocketMQClientTemplate.receiveAsync closes the shared SimpleConsumer, breaking all subsequent operations
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 88/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- backend, distributed-systems
Línea de trabajo
Comienza en RocketMQClientTemplate.receiveAsync(...) en rocketmq-v5-client-spring-boot y compáralo con receive() y destroy(). Ejecuta la prueba de regresión descrita con un consumidor falso que registre las operaciones; se considera terminado cuando el consumidor compartido siga siendo utilizable después de receiveAsync y su cierre sea gestionado por destroy().
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the Bug
RocketMQClientTemplate.receiveAsync(...) (rocketmq-v5-client-spring-boot) closes the shared SimpleConsumer right after starting an asynchronous receive:
SimpleConsumer simpleConsumer = this.getSimpleConsumer();
CompletableFuture<List<MessageView>> future = simpleConsumer.receiveAsync(maxMessageNum, invisibleDuration);
simpleConsumer.close(); // closes the shared singleton
return future;
The SimpleConsumer is a template-level singleton whose lifecycle belongs to the Spring bean's destroy() (which already closes it). Closing it here (1) disrupts the in-flight async receive it just started, and (2) permanently breaks the template: every subsequent receive/receiveAsync/ack/changeInvisibleDuration on the same template fails because the consumer is already closed. The synchronous receive() sibling does not close the consumer.
Steps to Reproduce
Call receiveAsync once, then any other consumer operation on the same template — it fails on the closed consumer.
What Did You Expect to See?
receiveAsync behaves like receive(): uses the shared consumer and leaves its lifecycle to destroy().
What Did You See Instead?
The shared consumer is closed after the first receiveAsync, breaking the async path and everything after it.
Additional Context
Fix incoming: remove the simpleConsumer.close() line; destroy() keeps its close. Includes a regression test with a recording fake consumer proving close is no longer invoked and the consumer stays usable.
- Lenguaje dominante
- Java
- Estrellas
- 2.3k
- Forks
- 941
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/rocketmq-spring
-
编译报错Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/rocketmq-spring#692 · 1 comentario ·
-
消费者注册时候对nameserver取值有点问题Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/rocketmq-spring#678 · 2 comentarios ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
apache/rocketmq-spring#670 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
apache/rocketmq-spring#609 · 3 comentarios ·
-
fix: AnnotationEnhancer chain silently discards all modifications in RocketMQMessageListenerBeanPostProcessorPosiblemente ocupada @lossend la tomó hace 136 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 25/100
apache/rocketmq-spring#776 · 8 comentarios ·
Todos los issues de apache/rocketmq-spring
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
oracle/graalvm-reachability-metadata#11472 ·
Los mantenedores suelen responder en 1 día
-
OkHttp versions 5.4.0+ no longer include baseline-prof.txtPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
lysine-dev/okhttp#9828 ·
Los mantenedores suelen responder en 1 día
-
status: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
spring-projects/spring-ai#7269 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 89/100
objectionary/hone-maven-plugin#1353 ·
Los mantenedores suelen responder en 9 días
-
ClassNotFoundException: io.netty.channel.kqueue.KQueueEventLoop stack trace printed during native build on main (Netty 4.2 removed the class)Posiblemente ocupada @gastaldi la tomó hoy. Abiertoarea/netty kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
quarkusio/quarkus#57939 · 1 comentario ·
Los mantenedores suelen responder en 1 día