Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple handlers @EventPattern() for the same event, with an interceptor and request scoped controller #10184

Closed
3 of 15 tasks
yuvall-cyera opened this issue Aug 28, 2022 · 1 comment · Fixed by #10209
Closed
3 of 15 tasks
Labels
needs triage This issue has not been looked into

Comments

@yuvall-cyera
Copy link

yuvall-cyera commented Aug 28, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When there are multiple handlers, listening to the same event (tested with Kafka), the expected behavior is that both handlers will be called (#6334).
But when an interceptor is also involved, and the controller is request scoped only one handler is being called.
The second one isn't being called - only its interceptor is being called

Minimum reproduction code

https://stackblitz.com/edit/nestjs-typescript-starter-8vgdfu?file=src%2Fapp.controller.ts,src%2Fmain.ts

Steps to reproduce

  1. npm start
  2. send a Kafka message with topic named topic

Expected behavior

Expect that both of the handlers will be called

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

No response

NestJS version

9.0.7

Packages versions

Node.js version

16.14.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@yuvall-cyera yuvall-cyera added the needs triage This issue has not been looked into label Aug 28, 2022
@yuvall-cyera yuvall-cyera changed the title multiple handlers @EventPattern() for the same event, with an interceptor multiple handlers @EventPattern() for the same event, with an interceptor and request scoped controller Aug 28, 2022
@kamilmysliwiec
Copy link
Member

Let's track this here #10209

kamilmysliwiec added a commit that referenced this issue Sep 19, 2022
…-handlers

fix(microservices): multiple scoped event handlers issue #10184
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants