import { Injectable } from '@nestjs/common' ; import { LoggerService } from '../../logger/logger.service' ; import { TRMQResponse } from '../rmq.constants' ; import { RMQProvider , RMQSubscription } from '../rmq.decorators' ; import { RmqService } from '../rmq.service' ; @ RMQProvider ( ) @ Injectable ( ) export class RmqRecieveService { constructor ( private readonly logger , public readonly rmqService ) { } @ RMQSubscription ( { exchange : `example` , routingKey : 'example_routing_key' , queue : `example_queue` , } ) protected async example ( msg ) { try { console . log ( msg ) ; return 'ack' ; } catch ( error ) { this . logger . error ( `RmqPublishService: send - ${ JSON . stringify ( error ) }` ) ; return 'nack' ; } } }