20 lines
508 B
TypeScript
20 lines
508 B
TypeScript
|
import { RabbitSubscribe } from '@golevelup/nestjs-rabbitmq';
|
||
|
import { Controller } from '@nestjs/common';
|
||
|
// import { Ad } from '../../domain/entities/ad';
|
||
|
|
||
|
@Controller()
|
||
|
export class AdMessagerController {
|
||
|
@RabbitSubscribe({
|
||
|
name: 'adCreated',
|
||
|
})
|
||
|
public adCreatedHandler(message: string) {
|
||
|
console.log(JSON.parse(message));
|
||
|
// try {
|
||
|
// const createdAd: Ad = JSON.parse(message);
|
||
|
// console.log(createdAd);
|
||
|
// } catch (e) {
|
||
|
// console.log('error', e);
|
||
|
// }
|
||
|
}
|
||
|
}
|