nest icon indicating copy to clipboard operation
nest copied to clipboard

nest microservice is not connecting

Open roeehershko opened this issue 8 years ago • 2 comments

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ ] Feature request
[*] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

i am trying to make communications between 2 apps with nestjs microservices (mqtt) i have the following connection code:

    const app = await NestFactory.create(AppModule);
    app.connectMicroservice({
        transport: Transport.MQTT,
        options: {
            host: 'mqtt',
            port: 1883,
        },
    });

    app.startAllMicroservicesAsync();
    await app.listen(3000);

just for testing, i also have anther app with the following code:

        const mqtt = require('mqtt')
        this.client = mqtt.connect('mqtt://mqtt');

When i am checking the mqtt server connections, i cant see the nestJS application i only see the other connection and therefore they cannot communicate. breaking my head over this for a while

roeehershko avatar Jun 02 '18 14:06 roeehershko

my bad, i used

        options: {
            host: 'mqtt',
            port: 1883,
        },

instead of URL, silly me

roeehershko avatar Jun 02 '18 19:06 roeehershko

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 24 '19 22:09 lock[bot]