eclipse-paho / eclipse-paho/paho.mqtt.javascript
Socket closed when subscribe 3000 topics
- 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
Assessment
This issue has not been assessed yet.