Skip to content

fix(constants): update RMQ_DEFAULT_QUEUE to an empty string #15250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

EeeasyCode
Copy link
Contributor

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: #13931

I checked the report that some of the code to resolve the issue in the past was missing. To solve this problem, I modified RQM_DEFAULT_QUEUE.

What is the new behavior?

AS-IS

// packages/microservices/constants.ts
export const RQM_DEFAULT_QUEUE = 'default';

TO-BE

// packages/microservices/constants.ts
export const RQM_DEFAULT_QUEUE = '';

Setting this to an empty string enables the use of the default automatically generated queue name.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8ac3b48e-5a80-4353-bcca-c2c6404c6460

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 88.94%

Totals Coverage Status
Change from base Build 2a2d45ae-2212-4040-b51f-83062dd35abc: 0.02%
Covered Lines: 7197
Relevant Lines: 8092

💛 - Coveralls

@EeeasyCode EeeasyCode changed the title fix(constants): update RQM_DEFAULT_QUEUE to an empty string fix(constants): update RMQ_DEFAULT_QUEUE to an empty string Jun 16, 2025
@kamilmysliwiec kamilmysliwiec merged commit 6f90f9b into nestjs:master Jul 14, 2025
5 checks passed
@gamunu
Copy link

gamunu commented Jul 22, 2025

This change started causing issues with our microservice healthchecks, we use terminus and it started creating queues and exhuasted the resources, our prod and dev clusters both we had to rebuild from scrach.

This should be at least a minor change not a patch

@VaughanHarv
Copy link

VaughanHarv commented Jul 23, 2025

This change started causing issues with our microservice healthchecks, we use terminus and it started creating queues and exhuasted the resources, our prod and dev clusters both we had to rebuild from scrach.

This should be at least a minor change not a patch

Agree, we had the exact same issue with our health check.
From what i can see, this is as a result of using the microservice pingCheck if not specifying a queueName, which was previously 'deafult'.

Setting the queue name in the options resolved this.
I believe the documentation should be updated to note using pingCheck without a queue name causes poor handling of the generated queues.
Alternative, microservice ping check by default should have a queue name + durable + autoDelete queue settings inbuilt.

async pingCheck(): Promise<HealthIndicatorResult> {
    const queueUrl = this.configService.get('RABBIT_MQ_URL');
    const queueOptions = {
      transport: Transport.RMQ,
      options: {
        urls: [queueUrl],
        queue: 'amqp-ping-check-queue'.
        queueOptions: { durable: false },
        socketOptions: { noDelay: true },
        headers: {},
      },
    };
    return await this.microservice.pingCheck(
      `${HealthCheckSystems.AMQP}_${HealthCheckTypes.PING}`,
      queueOptions,
    );
  }

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.

6 participants