-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
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.
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.
my config is as below
{
host,
connectHeaders: {
login,
passcode,
},
ssl: true,
port: 61614,
timeout: 10000
}
Metadata
Metadata
Assignees
Labels
No labels