Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#780 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

@wang-jiahua がすでに取り組んでいます。

2026年9月3日 から。

  • #781 @wang-jiahua による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java

調査の方向性

rocketmq-v5-client-spring-boot の RocketMQClientTemplate.receiveAsync(...) から始め、receive() および destroy() と比較します。記録用の fake consumer を使って説明されている回帰テストを実行します。完了条件は、receiveAsync の後も共有 consumer が引き続き使用可能であり、その close が destroy() によって処理されることです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
2.3k
フォーク
941
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/rocketmq-spring のほかの issue

apache/rocketmq-spring の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。