DEV Community

Discussion on: Kafka Microservice using Nest Js

Collapse
 
igortas profile image
Igor Tashevski

This is weird example. Why the producer service, has @client decorator?

Collapse
 
kannndev profile image
Kannan

I am not sure why do you call this weird. Producer is the service which generates the message so that is why it has a client decorator.

Collapse
 
igortas profile image
Igor Tashevski

I was more thinking, if is possible to annotate the services in a way, what is what, server-service, client-service. There is ServerKafka class, but I can't find way how to use it. There is nothing like @client decorator, to be replaced, like @server.

Thread Thread
 
kannndev profile image
Kannan

Why would you need a decorator for Server. Here the consumer is a microservice server listening on kafka queues. A single service class cannot become a server isnt it?

Thread Thread
 
igortas profile image
Igor Tashevski

When it's appropriate to use ServerKafka class?

Thread Thread
 
kannndev profile image
Kannan

Can you point me to the documentation where you found this.

Thread Thread
 
igortas profile image
Igor Tashevski

docs.nestjs.com/microservices/kafk...
But I can't find nothing related to where ServerKafka class, made sense to use it.

Thread Thread
 
kannndev profile image
Kannan

I dont think server kafka is a class here. Its just the name tht they use to distinguish between client and server