Skip to content

feat(microservices): add "maxConnectionAttempts" option to RMQ, hide urls log - #10042

Merged
kamilmysliwiec merged 1 commit into
masterfrom
feat/rmq-max-connection-attempts
Jul 28, 2022
Merged

kamilmysliwiec merged 1 commit into
masterfrom
feat/rmq-max-connection-attempts

Conversation

@kamilmysliwiec

Copy link
Copy Markdown
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #10029

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 6db6b28b-452c-478b-be7c-8b9f6c3f2185

  • 4 of 12 (33.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 93.825%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/microservices/server/server-rmq.ts 4 12 33.33%
Totals Coverage Status
Change from base Build 72b8f4f8-0820-47dd-aa70-f48b5b84dd57: -0.1%
Covered Lines: 6093
Relevant Lines: 6494

💛 - Coveralls

@kamilmysliwiec
kamilmysliwiec merged commit 14473cc into master Jul 28, 2022
@delete-merged-branch
delete-merged-branch Bot deleted the feat/rmq-max-connection-attempts branch July 28, 2022 14:02
kamilmysliwiec added a commit that referenced this pull request Oct 20, 2026
* fix(microservices): count every failed rmq connection attempt

amqp-connection-manager emits "connectFailed" after every failed
attempt and keeps reconnecting. Since the v11 refactor, ServerRMQ binds
its handler with once(), so only the first failure is counted and a
maxConnectionAttempts above 1 is never reached. listen() then never
settles while the broker is down.

Bind the handler with on() again, as #10042 did when it added the
option. The handler already ignores events after the limit through
settleListenCallback.

* fix(microservices): reset rmq connection attempts on each start

The counter was never reset, so a listen() after a failed one started above maxConnectionAttempts and never reached it.

---------

Co-authored-by: Kamil Myśliwiec <mail@kamilmysliwiec.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants