stompjs icon indicating copy to clipboard operation
stompjs copied to clipboard

Max reconnect attempts and exponential back-off

Open crohde7707 opened this issue 4 years ago • 7 comments

I was looking for an example where I could either set a max number of reconnect attempts, and couldn't find any. I saw an issue on the ng2-stompjs project, but is there one specific to this project?

crohde7707 avatar Jun 19 '20 14:06 crohde7707

I will add a FAQ entry for this soon. Give me few days.

kum-deepak avatar Jun 20 '20 10:06 kum-deepak

Thanks, any update on this?

crohde7707 avatar Jun 24 '20 13:06 crohde7707

I have created a branch of samples implementing this. It also implements exponential back-off, i.e., each subsequent connection attempt will after 200, 400, 800, 1600 ... ms.

See the diff at https://github.com/stomp-js/samples/pull/4/files and full source at https://github.com/stomp-js/samples/blob/max-reconnects/stompjs/chat/chat.html

kum-deepak avatar Jun 25 '20 12:06 kum-deepak

Awesome, thanks for the samples!

crohde7707 avatar Jun 25 '20 15:06 crohde7707

Keeping it open for a while till I create a FAQ entry.

kum-deepak avatar Jun 25 '20 15:06 kum-deepak

Is this still open? :( I need some option like maxAttempt: 10

kyun avatar Jan 06 '22 01:01 kyun

Is there a solution or workaround for configuring max reconnect attempts?

Rupa2398 avatar May 21 '23 09:05 Rupa2398