Skip to content
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

@nestjs/microservices should handle RabbitMQ bindings and auto-generated queues #13931

Open
1 task done
pitazzo opened this issue Aug 30, 2024 · 0 comments
Open
1 task done
Labels
needs triage This issue has not been looked into type: enhancement 🐺

Comments

@pitazzo
Copy link

pitazzo commented Aug 30, 2024

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

The behavior of @nestjs/microservices while creating a new microservice app does not match the behavior expected to the regular amqplib package. So far, for a configuration as this, I've encountered this mismatch in two situations:

  const app = await NestFactory.createMicroservice(AppModule, {
    transport: Transport.RMQ,
    options: {
      urls: ['amqp://localhost:5672'],
      queue: '',
      queueOptions: {
        exclusive: true,
      },
      noAck: false,
      exchange: 'a.b.c',
      routingKey: 'x.y.*.z',
    },
  });
  await app.listen();
  • Passing an empty string as queue name won't create an exclusive queue with a name in the form amq.gen-cf6fXOViIyb..., instead creates one called default.
  • Specifying exchange and routingKey should bind the queue to the exchange, and that does not happen.

Describe the solution you'd like

For the given situations:

  • The queues should be named in the expected format
  • The binding should automatically happen

Teachability, documentation, adoption, migration strategy

  • In the RabbitMQ docs should be covered in detail which parameters can be passes to the options object.
  • Final behavior should be the same as described here.

What is the motivation / use case for changing the behavior?

With the current behavior, some basic features of RabbitMQ can be achieved out of the box. Instead, some manual tweaking is needed.

@pitazzo pitazzo added needs triage This issue has not been looked into type: enhancement 🐺 labels Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into type: enhancement 🐺
Projects
None yet
Development

No branches or pull requests

1 participant