You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a huge traffic for my API and I feel making a connection for each request is not right. I want to know if there is way to keep the connection open or some sort of pooling is available in the library. Below is my sample code where the function conn is called on each request.
function conn() {
............
............
const failover = new stompit.ConnectFailover(servers, reconnectOptions);
failover.connect((error, client) => {
if (error) {
throw new Error(error);
}
const frame = client.send(sendHeaders);
frame.write('my message');
frame.end();
client.disconnect();
return 'success';
});
}
Also, how do we set a connection timeout? I want to throw an error if the connection is taking long to establish. The default is 3000 but it does not work. I even tried setting it up separately and even that did not work.
Hello,
I have a huge traffic for my API and I feel making a connection for each request is not right. I want to know if there is way to keep the connection open or some sort of pooling is available in the library. Below is my sample code where the function
conn
is called on each request.Also, how do we set a connection timeout? I want to throw an error if the connection is taking long to establish. The default is 3000 but it does not work. I even tried setting it up separately and even that did not work.
my config is as below
The text was updated successfully, but these errors were encountered: