Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug] RocketMQClientTemplate.receiveAsync closes the shared SimpleConsumer, breaking all subsequent operations

Abierto Apto para principiantes
#780 3 comentarios 0 reacciones 0 asignados Ver en GitHub

@wang-jiahua ya está trabajando en esto.

Desde el 3/9/2026.

  • #781 de @wang-jiahua — abierto

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

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/rocketmq-spring

Todos los issues de apache/rocketmq-spring

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.