question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Aedes stops exactly after 100 messages

See original GitHub issue

Hello, I didn’t open a bug issue because it’s probably something wrong with my code. I have two clients connected to aedes, one to publish and one to receive the messages, but after 100 messages aedes stops receiving. Below my aedes server code:

const aedes = require('aedes')()
const server = require('net').createServer(aedes.handle)
const port = 1883

const initAedes = () => {

    server.listen(port, function () {
        console.log('Mqtt server started and listening on port ', port)
    })

    aedes.subscribe('consumption', function (packet, cb) {
        console.log('Received: ', packet.payload.toString());
    });

}

My publisher:

client.on('connect', function () {
        client.subscribe('consumption');

        let ctr = 0;
        setInterval(() => {
            ctr++;
            console.log('publishing: ' + ctr);
            client.publish('consumption', ctr.toString());
        }, 100);

    })

My receiver:

client.subscribe('consumption');
    client.on('message', function (topic, message) {
        console.log('Received: ' + message.toString())
    })

Sorry if I misunderstood something, I’m a newbie.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mcollinacommented, Dec 21, 2020

You are not calling the callback inside the function you pass to subscribe.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aedes stops responding after 99 messages when a client has ...
The correct way of operation when concurrency limit was hit, is to deliver queued messages and then continue accepting new. Today I've ...
Read more >
Getting Eaten Alive By Mosquitoes? Here's All You Ever ...
The relentless Aedes mosquito has been spotted in a host of places — Los Angeles, Orange, Riverside, San Bernardino, San Diego, Tulare, Merced ......
Read more >
How to Install and Run The Aedes MQTT Broker on Node-Red
Click on the install tab and search for aedes. aedes-broker-location. After the install you should find a new node called aedes under the ......
Read more >
Species Elimination Is Usually Not A Good Idea - NPR
Aedes aegypti are not a big food source for animals, and they don't pollinate plants. "There's been lots of debate in the last...
Read more >
Genetically Modified Mosquitoes Have Come to the U.S. | Time
U.K.-based biotech firm Oxitec is releasing genetically modified mosquitoes in the Florida Keys as population control. Will they work?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found