`@RabbitConsumer()
export class BuyerConsumer {
constructor(
private readonly ondcService: OndcService,
private readonly coreService: CoreService,
private readonly participantService: ParticipantService,
) {
console.log(participantService); // This works fine
}
@RabbitHandler('queue_name')
async helloWorld({}: DTO) {
console.log(this.participantService); // This does not work -> participantService = undefined
}
}`
I have created a wrapper around @Controller (named @RabbitConsumer), it works absolutely fine until I import participantService in the BuyerConsumer.
As soon as I pass the ParticipantService to BuyerConsumer constructor, all the three service become empty. I start getting following error:
[Nest] 239 - 01/28/2024, 6:52:20 AM ERROR [AmqpService] TypeError: Cannot read properties of undefined (reading 'getProducts')
I can share the implementation of AmqpService as well. But, it just uses nestjs discovery service to fetch all the dependencies and calls the method based on few conditions.