#Is the microservice package (using Redis) supposed to log twice?
20 messages · Page 1 of 1 (latest)
Do you add the ClientsModule.register() to multiple modules?
Nope
Here is what I have:
It's towards the bottom off this image, only in this global module.
The only module I am this module in is the app module, unless I shouldn't be
Hmmm, that seems a bit interesting
Yea.
Can you provide a quick reproduction with this?
Yeah, I'll try and keep it simple
hold on im improving the reproduction
Okay, the current build reproduces the steps:
Also, the goal with this is to be able to use the .send method and receive that message data from another nest application in a different docker container. As of now, the receiving container does not successfully receive the message and I am not sure why or if it's related to this.
Just to clarify, everything seems to work normally now, but I still get that log twice for some reason. As far as I know, the .send method fires once.
Good to know. I'll be trying to look into it here soon. Day job has been taking my attention
No worries, thank you
I've been also noticing creation of the same service several times after updating to nestjs v11 (I noticed it because it logged the message from the init method several times)
My problem is not related to Redis, just in my other two services that ai tried to update from nestjs v10
Just out of curiosity, is there any update on this/why the issue might be occurring?
Do you have more than one client (inside clients module?)
By reading the code, you should see one log per client that you declare in that list due to:
- https://github.com/nestjs/nest/blob/master/packages/microservices/module/clients.module.ts#L102-L110
- https://github.com/nestjs/nest/blob/master/packages/microservices/module/clients.module.ts#L37-L43
Experiment changing the moduleIdGeneratorAlgoritm to deep-hash in the createApp (https://docs.nestjs.com/migration-guide#module-resolution-algorithm)
A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀 - nestjs/nest
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
Do you have more than one client (inside clients module?)
Whatever is in that reproduction is how I am registering the Clients Module in the actual program. There is only one module which registers it and I am only using one Redis connection/client.