Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RabbitMQ in NestJS, error on both Producer and Consumer

I have the following app https://github.com/rengthp/nestjs-rabbitmq-microservice

But I get on Producer :

[Nest] 6156 - 04/03/2021, 13:28:53 [ClientProxy] Disconnected from RMQ. Trying to reconnect. +25469ms [Nest] 6156 - 04/03/2021, 13:28:53 [ClientProxy] Object:

{
  "err": {
    "code": 406,
    "classId": 50,
    "methodId": 10
  }
}
 +3ms

and on Consumer:

111ms
[Nest] 1180   - 04/03/2021, 13:22:31   [Server] Disconnected from RMQ. Trying to reconnect. +1058ms
[Nest] 1180   - 04/03/2021, 13:22:37   [Server] Disconnected from RMQ. Trying to reconnect. +6006ms
[Nest] 1180   - 04/03/2021, 13:22:43   [Server] Disconnected from RMQ. Trying to reconnect. +6017ms
[Nest] 1180   - 04/03/2021, 13:22:49   [Server] Disconnected from RMQ. Trying to reconnect. +6026ms

What could be wrong? the server is working...

like image 605
CarlosMagalhaes Avatar asked Oct 17 '25 12:10

CarlosMagalhaes


1 Answers

This error came up because you re-declare an existing queue with different parameters. The solution is simple. The option queue for both producers and consumers must be the same and all option parameters must be the same.

like image 84
DamarOwen Avatar answered Oct 20 '25 22:10

DamarOwen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!