@nestjs/microservices: RabbitMQ connection options not passed to amqp-connection-manager #13429
Closed
4 of 15 tasks
Labels
needs triage
This issue has not been looked into
Is there an existing issue for this?
Current behavior
I have a RabbitMQ node configured with mtls authentication. The problems occurs when I create a nest microservice.
I saw that RabbitMQ connection options were introduced recently (#13071) but are wrongly typed (it's more that the option is not correctly passed).
When you look at the type (https://github.com/nestjs/nest/pull/13105/files#diff-c0aee1a2515f55f6e0244d04cb7c8af79cdd192434a4ea6648fef2c8a0b1d3fdR51) they have to be defined inside Socket Options.
For instance, the following won't work, even if the type is define as this:
Therefore, we can see there (https://github.com/nestjs/nest/pull/13105/files#diff-be75f6c9c2c9a1228b67565a1a57063e16dceb983af8ee57fefb1bbeb2168dc7R136) that the socketOption object is passed into connectionOptions to amqp-connection-manager. It should be passed directly as second argument and not passed into connectionOptions, as socketOptions is already what the amqp-connection-manager is expecting as second argument ! As so, the connection is not configured...
We have the same issue at that point: https://github.com/nestjs/nest/pull/13105/files#diff-93437b04ed0526d1c6af30ba24b8828f140177bfb366ae6dd1dd17e8ed58cf88R139
I hope that I made myself clear.
Minimum reproduction code
https://github.com/JonathanMbt/nestjs-rabbitmq-connection-options-fail
Steps to reproduce
No response
Expected behavior
SocketOptions should not be passed down to connectionOptions, and only the connectionOptions should be passed. So that the Rabbitmq connection options would be taken into account and would permit us to use the nest/microservices with RabbitMQ when using tls authentication.
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
10.3.7
Packages versions
Node.js version
18.13.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: