import { Injectable } from '@nestjs/common' ; import { SubscribeTo , SubscribeToFixedGroup , } from '../common/kafka/kafka.decorator' ; import { KafkaPayload } from '../common/kafka/kafka.message' ; import { HELLO_FIXED_TOPIC } from '../constant' ; @ Injectable ( ) export class ConsumerService { param payload @ SubscribeTo ( 'hello.topic' ) helloSubscriber ( payload ) { console . log ( '[KAKFA-CONSUMER] Print message after receiving' , payload ) ; } param payload @ SubscribeToFixedGroup ( HELLO_FIXED_TOPIC ) helloSubscriberToFixedGroup ( payload ) { console . log ( '[KAKFA-CONSUMER] Print message after receiving for fixed group' , payload ) ; } param payload @ SubscribeTo ( 'hello.topic2' ) helloSubscriber2 ( payload ) { console . log ( '[KAKFA-CONSUMER] Print message after receiving' , payload ) ; } }