eclipse-paho / eclipse-paho/paho.mqtt.javascript

Socket closed when subscribe 3000 topics

Open
#152 1 comment 0 reactions 1 assignee Claimed by @jpwsutton View on GitHub
question
Dominant language
JavaScript
Stars
1.2k
Forks
466
PR merge metrics
No merged PRs in 30d

Description

AMQJS0008I Socket closed

```
function onConnect() {
// Once a connection has been made, make a subscription and send a message.
console.log("onConnect");
// client.subscribe("World");
//about 3000 topics
for (var i = 0; i < topics.length; i++) {
var topic = topics[i];
for (var key in topic) {
client.subscribe(key);
//console.log("subscribe:"+key); when add this line will be ok. It seems to be blocking
current thread
}
}

}

// called when the client loses its connection
function onConnectionLost(responseObject) {
if (responseObject.errorCode !== 0) {
console.log("onConnectionLost:" + JSON.stringify(responseObject));
}else{
console.log("onConnectionLost:" + 0 );
}
}

```
How to subscribe to multiple topics using one request?
If have any idea how to solve this issue, please help me!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.