Is there a way to use NestJS microservices with the pub/sub pattern? For example with amqp? As far as I understand, every 'microservice type' is following the request / response pattern.
@EventPattern('user_created')
async handleUserCreated(data: Record<string, unknown>) {
// business logic
}
async publish() {
this.client.emit<number>('user_created', new UserCreatedEvent());
}
The above solution does not work. See here https://github.com/nestjs/nest/issues/3981
As per the NestJs documentation, you have two options.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.