Closed mwolf1989 closed 3 weeks ago
Also i can only see the api-gw binding in rmq:
ok it starts working when doing the boostrap with this:
async function bootstrap() {
const app = await NestFactory.create(GenesysEventsModule);
app.useLogger(app.get(Logger));
await app.startAllMicroservices();
app.listen(3000).then(() => {
console.log('Genesys Events Service is running on port 3000');
});
}
bootstrap();
but not with:
async function bootstrap() {
const app = await NestFactory.create(GenesysEventsModule);
app.useLogger(app.get(Logger));
await app.startAllMicroservices();
}
bootstrap();
Is there a way to avoid this?
@mwolf1989 You'll have to execute listen
so that our module is invoked, you can bind to a random port and then prevent any public access to it but usually you should expose a /healthz
endpoint anyway so HTTP would be needed.
I'm not sure why you're using startAllMicroservices
, which's not applicable for golevelup module, that's only specific to the official nestjs
We have an example over here
We're implementing a microservices architecture using NestJS and RabbitMQ for inter-service communication. The current goal is to distribute messages from one service to multiple other services using RabbitMQ.
In My API-GW Module it works:
I can emit an event:
And also Subscribe:
I if i add a secound service with:
and do the same with:
and as Subscriber:
I dont see any log.
I noticed in the log for the apigw:
But not for the other service... what am i doing wrong there?
NestJS is v10 and "@golevelup/nestjs-rabbitmq": "^5.5.0",
Thanks in advance
Marcel