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
66.89k stars 7.56k forks source link

Microservice timeout #9844

Closed Hermit90 closed 2 years ago

Hermit90 commented 2 years ago

Is there an existing issue for this?

Current behavior

Hello, I would like to have your expertise on a problem I have been having for a while with Nestjs I have a Monorepo and microservice architecture. My project is also a multi tenant. My problem is that I cannot execute more than 9 requests to my different microservices. After 9 requests I have a timeout which means that I have to restart the project for it to run.

I used REDIS; KAFKA (abandoned since the consumer is unique); I opted for RABBITMQ.

How can I solve the problem and has anyone experienced such a problem? Thank you for assisting me

Minimum reproduction code

git@github.com:Hermit90/issuer.git

Steps to reproduce

No response

Expected behavior

Microservice: Timeout Gateway: Internal error

Package

Other package

No response

NestJS version

8.0.0

Packages versions

{ "name": "stable-ricva", "version": "0.0.1", "description": "", "author": "", "private": true, "license": "UNLICENSED", "scripts": { "prebuild": "rimraf dist", "build": "NODE_ENV=production nest build", "format": "prettier --write \"apps//*.ts\" \"libs/*/.ts\"", "start": "nest start --watch", "start:dev": "NODE_ENV=development nest build --webpack --webpackPath webpack-hmr.config.js --watch", "start:debug": "NODE_ENV=development nest start --debug --watch", "start:prod": "NODE_ENV=production node dist/main", "lint": "eslint \"{src,apps,libs,test}//.ts\" --fix", "test": "jest", "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./apps/stable-ricva/test/jest-e2e.json", "pm2:gateway": "./service.sh ./start/pm2-no-cluster/pm2-gateway.json", "pm2:auth": "./service.sh ./start/pm2-no-cluster/pm2-auth.json", "pm2:sup": "./service.sh ./start/pm2-no-cluster/pm2-sup.json", "pm2:admin": "./service.sh ./start/pm2-no-cluster/pm2-admin.json", "pm2:ops": "./service.sh ./start/pm2-no-cluster/pm2-ops.json", "pm2:fin": "./service.sh ./start/pm2-no-cluster/pm2-fin.json", "pm2:stats": "./service.sh ./start/pm2-no-cluster/pm2-stats.json" }, "dependencies": { "@nestjs/common": "^8.0.0", "@nestjs/config": "^2.0.0", "@nestjs/core": "^8.0.0", "@nestjs/jwt": "^8.0.0", "@nestjs/microservices": "^8.4.4", "@nestjs/passport": "^8.2.1", "@nestjs/platform-express": "^8.0.0", "@nestjs/swagger": "^5.2.1", "@nestjs/throttler": "^2.0.1", "@nestjs/typeorm": "^8.0.3", "@types/bcrypt": "^5.0.0", "@types/multer": "^1.4.7", "amqp-connection-manager": "^4.1.3", "amqplib": "^0.10.0", "aws-sdk": "^2.1125.0", "bcrypt": "^5.0.1", "class-transformer": "^0.5.1", "class-validator": "^0.13.2", "helmet": "^5.0.2", "joi": "^17.6.0", "multer-s3": "^2.10.0", "passport": "^0.5.2", "passport-jwt": "^4.0.0", "pg": "^8.7.3", "rand-token": "^1.0.1", "reflect-metadata": "^0.1.13", "request-ip": "^2.1.3", "rimraf": "^3.0.2", "rxjs": "^7.2.0", "swagger-ui-express": "^4.3.0", "typeorm": "0.2", "typeorm-snake-naming-strategy": "^1.0.2", "uuid": "^8.3.2" }, "devDependencies": { "@nestjs/cli": "^8.0.0", "@nestjs/schematics": "^8.0.0", "@nestjs/testing": "^8.0.0", "@types/express": "^4.17.13", "@types/jest": "27.4.1", "@types/node": "^16.0.0", "@types/passport-local": "^1.0.34", "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", "eslint": "^8.0.1", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^27.2.5", "prettier": "^2.3.2", "run-script-webpack-plugin": "^0.0.11", "source-map-support": "^0.5.20", "supertest": "^6.1.3", "ts-jest": "^27.0.3", "ts-loader": "^9.2.3", "ts-node": "^10.0.0", "tsconfig-paths": "^3.10.1", "typescript": "^4.3.5", "webpack": "^5.72.0", "webpack-node-externals": "^3.0.0" }, "jest": { "moduleFileExtensions": [ "js", "json", "ts" ], "rootDir": ".", "testRegex": ".\.spec\.ts$", "transform": { "^.+\.(t|j)s$": "ts-jest" }, "collectCoverageFrom": [ "*/.(t|j)s" ], "coverageDirectory": "./coverage", "testEnvironment": "node", "roots": [ "/apps/", "/libs/" ], "moduleNameMapper": { "^@app/saas-component(|/.*)$": "/libs/saas-component/src/$1" } } }

Node.js version

v14.17.5

In which operating systems have you tested?

Other

No response

kamilmysliwiec commented 2 years ago

Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.