Skip to content

fix(nodejs): fail fast on NotFoundException during startup route fetch - #1374

Merged
RongtongJin merged 2 commits into
apache:masterfrom
zhaohai666:fix/nodejs-startup-route-fail-fast
Sep 23, 2026
Merged

RongtongJin merged 2 commits into
apache:masterfrom
zhaohai666:fix/nodejs-startup-route-fail-fast

Conversation

@zhaohai666

@zhaohai666 zhaohai666 commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

P2 fix(nodejs): fail fast on NotFoundException during startup route fetch

Startup rejects immediately when the initial QueryRoute returns NotFoundException,
instead of silently retrying forever. Non-not-found errors keep the 3-attempt retry
with linear backoff, so the error message and cause chain now carry
NotFoundException(40402) directly.

Files: nodejs/src/client/BaseClient.ts (1 hunk)

Non-not-found errors keep the 3-attempt retry with linear backoff, but
NotFoundException (topic/consumer group does not exist) can never succeed
on retry - surface it immediately so the error message and cause chain
carry NotFoundException(40402) instead of a generic 'Failed to fetch
topic routes after 3 attempts' wrapper.
@zhaohai666
zhaohai666 force-pushed the fix/nodejs-startup-route-fail-fast branch from de7cebe to c30f417 Compare September 15, 2026 03:40

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Fail-fast on NotFoundException during startup route fetch — clean, focused fix that aligns with the Java client behavior.

The logic is correct: if the initial QueryRoute returns NotFound, retrying will never succeed, so throwing immediately is the right call. The added tsconfig.test.json is a reasonable addition for test compilation.

CI is green. LGTM.

Note: This PR and #1375/#1376 all add the same tsconfig.test.json. If merged sequentially, the later PRs will have a merge conflict on that file. Consider coordinating the merge order or consolidating the file into one PR.


Automated review by github-manager-bot

@RongtongJin
RongtongJin merged commit 2a554b9 into apache:master Sep 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants