Nodejs is disconnected from Rainbow platform
Hi , I have developed a Nodejs application with version 2.25.2-lts.11
I noticed some times that the rainbowSDK.events.on('rainbow_ondisconnected' is called
In this case the application cannot receive or send any Instant Message.
The options in my application are:
let options = {
"rainbow": {
"host": "sandbox.openrainbow.com"
},
"credentials": {
"login": USER_NAME,// To replace by your developer credendials
"password": PASSWORD// To replace by your developer credentials
},
// Application identifier
"application": {
"appID": appID,
"appSecret": appSecret
},
// Logs options
"logs": {
"enableConsoleLogs": true,
"enableFileLogs": true,
"color": true,
"level": 'debug',
"customLabel": "mxar",
"system-dev": {
"internals": false,
"http": false,
},
"file": {
"path": "/var/tmp/rainbowsdk/",
"customFileName": "R-SDK-Node-Sample2",
// "level": "debug",
"zippedArchive" : false,
/* maxSize : '10m',
maxFiles : 10 */
}
},
// IM options
"im": {
"sendReadReceipt": true,
"messageMaxLength": 14024, // the maximum size of IM messages sent.
"sendMessageToConnectedUser": false, // When it is setted to false it forbid to send message to the connected user. This avoid a bot to auto send messages.
"conversationsRetrievedFormat": "small", // It allows to set the quantity of datas retrieved when SDK get conversations from server. Value can be "small" of "full"
"storeMessages": false, // Define a server side behaviour with the messages sent. When true, the messages are stored, else messages are only available on the fly. They can not be retrieved later.
"nbMaxConversations": 15, // parameter to set the maximum number of conversations to keep (defaut value to 15). Old ones are removed from XMPP server. They are not destroyed. The can be activated again with a send to the conversation again.
"rateLimitPerHour": 900000, // was 10000 Set the maximum count of stanza messages of type `message` sent during one hour. The counter is started at startup, and reseted every hour.
//"messagesDataStore": RainbowSDK.DataStoreType.StoreTwinSide
},
"requestsRate": {
"useRequestRateLimiter": true,
"maxReqByIntervalForRequestRate": 20250, // nb requests during the interval.
"intervalForRequestRate": 60, // nb of seconds used for the calcul of the rate limit.
"timeoutRequestForRequestRate": 600, // nb seconds Request stay in queue before being rejected if queue is full.
},
"xmpp":{
"maxIdleTimer": 50000
}
};
Why the nodeJS application is disconnected?
How can I connect again?
Thanks in advance
Marios
-
Hello,
The disconnected State happens when one of the 2 links is down REST/XMPP.
Note that, the SDK should reconnect automaticaly, so if it stays on a state != than ready, then maybe a fatal error happens also.
rainbow_onfailed Fired when the SDK didn't succeed to reconnect and stop trying rainbow_onerror Fired when something goes fatal on Xmpp server (ie: bad 'configurations' parameter...). Used by application to start the sdk again.
if these errors are raised then the reconnection must be manage by application.
https://developers.openrainbow.com/doc/sdk/node/lts/guides/Connecting_to_Rainbow_XMPP_Mode
Maybe some logs could help to confirm that it is your issue.
Best Regards,Vincent.
Por favor, entrar para comentar.
Comentários
1 comentário