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.9k stars 7.55k forks source link

RabbitMQ EventPattern don't work #13769

Closed cholombytko closed 2 months ago

cholombytko commented 2 months ago

Is there an existing issue for this?

Current behavior

I have error in terminal

ERROR [Server] There is no matching event handler defined in the remote service. Event pattern: add_subscriber

Minimum reproduction code

https://github.com/GenesisEducationKyiv/software-engineering-school-4-0-cholombytko/blob/hw6/monolith/subscription/src/app.controller.ts

Steps to reproduce

  1. docker-compose up --build
  2. Create POST request to http://localhost:3000/subscribe with body:
    {
    "email": "example@email.com"
    }

Expected behavior

Mine expected working workflow is:

  1. Creating POST request
  2. Emitting event with email data;
  3. Store this data in PostgreSQL database

Package

Other package

No response

NestJS version

9.4.3

Packages versions

{
    "@nestjs/cli": "^9.0.0",
    "@nestjs/config": "^3.2.3",
    "@nestjs/microservices": "^9.4.3",
    "@nestjs/schematics": "^9.0.0",
    "@nestjs/testing": "^9.0.0",
    "@nestjs/typeorm": "^10.0.2",
    "@types/express": "^4.17.13",
    "@types/jest": "29.5.1",
    "@types/node": "18.16.12",
    "@types/supertest": "^2.0.11",
    "@typescript-eslint/eslint-plugin": "^5.0.0",
    "@typescript-eslint/parser": "^5.0.0",
    "amqp-connection-manager": "^4.1.14",
    "amqplib": "^0.10.4",
    "dotenv": "^16.4.5",
    "eslint": "^8.0.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "jest": "29.5.0",
    "pg": "^8.12.0",
    "prettier": "^2.3.2",
    "source-map-support": "^0.5.20",
    "supertest": "^6.1.3",
    "ts-jest": "29.1.0",
    "ts-loader": "^9.2.3",
    "ts-node": "^10.0.0",
    "tsconfig-paths": "4.2.0",
    "typeorm": "^0.3.20",
    "typescript": "^5.0.0"
  }

Node.js version

20.8.0

In which operating systems have you tested?

Other

No response

kamilmysliwiec commented 2 months ago

Thank you for taking the time to submit your report! From the looks of it, this could be better discussed on our Discord. If you haven't already, please join here and send a new post in the #ā  šŸˆ nestjs-help forum. Make sure to include a link to this issue, so you don't need to write it all again. We have a large community of helpful members, who will assist you in getting this to work.