nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
67.76k stars 7.64k forks source link

Is that a bug in server-rmq.js??? #3006

Closed waynehong789 closed 5 years ago

waynehong789 commented 5 years ago

Bug Report

Current behavior

Returning undefined "data" & "pattern", after deserialized incoming message at "server-rmq.js".

Input Code

At line 64 of "server-rmq.js" : const packet = this.deserializer.deserialize(rawMessage);

But at line 5 of "incoming-request.deserializer.js" : deserialize(value, options) { return this.isExternal(value) ? this.mapToSchema(value, options) : value; }

Looks like it expected two parameters, but only one provided from line 64 of "server-rmq.js".

Expected behavior

It should return the data with RMQ queue payload.

Possible Solution

Pass the options from line 64 of "server-rmq.js"

Environment

"@nestjs/common": "^6.0.0",
"@nestjs/core": "^6.0.0",
"@nestjs/cqrs": "^6.0.1",
"@nestjs/microservices": "^6.6.7",
"@nestjs/mongoose": "^6.1.2",
"@nestjs/platform-express": "^6.0.0",
"@nestjs/platform-socket.io": "^6.7.1",
"@nestjs/websockets": "^6.7.1",

For Tooling issues:

Others:

kamilmysliwiec commented 5 years ago

Please, provide a minimal repository which reproduces your issue.

waynehong789 commented 5 years ago

Unfortunately, I cannot provide a repository. I am using RabbitMQ Management to publish a queue data and expecting Nestjs back end listening on the event pattern from RMQ module. I solved the problem by passing payload data object with "pattern" and "data" keys. Because there is a method: " isExternal" in "incoming-request.deserializer.js". It can return the "value", once it has "pattern" or "data" keys. But I still thinking it's not a good practice at line 64 of "server-rmq.js" : const packet = this.deserializer.deserialize(rawMessage); It only provides one parameter, but not two as expected at line 5 of "incoming-request.deserializer.js" : deserialize(value, options).

Anyway, thanks for reply @kamilmysliwiec.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.