davinkevin / AngularStompDK

Angular service to communicate to Stomp-Websocket
http://davinkevin.github.io/AngularStompDK/
Apache License 2.0
36 stars 12 forks source link

If server goes down, AngularStompDK will automatically reconnect over a hundred times after it comes up at times #49

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello, If I put the server down to update it, when it comes back up, clients will keep connecting to it over and over. Sometimes it is over a hundred times per client that is only receiving & sending messages.

davinkevin commented 7 years ago

I don't really understand the element you describe. Could you describe with a step by step and/or example ?

There is a Spring project with simple element. If I shutdown the server and start it again, all the subscription are working well...

ghost commented 7 years ago

One user

That is all one user.

My JavaScript code doesn't detect disconnections nor try to reconnect.

When the server was down, AngularStompDK attempted to reconnect over a hundred times in 30 minutes, most of them in the first minute it seems.

This itself isn't a problem, but the connections are left open with the server returns to life.

Here is detail of connection:

Connection detail

davinkevin commented 7 years ago

I don't know if the problem is located at the AngularStompDK level, inside StompJS or outside of the JS scope.

Do you have an system between your web client and the backend receiving the Stomp request ? Like a reverse proxy (nginx) or something else which retries the connection if they fail too ?

Can you test with the spring project to reproduce this behavior ? Because I won't be able to solve a bug if it's specific to your infrastructure.

If you want to remove this behavior for now, you can configure AngularStompDK to not try to reconnect or to use an bigger interval than default one.

ghost commented 7 years ago

It is just AngularStompDK -> RabbitMQ WebStomp plugin. Amazon AWS is handling SSL into the WebSocket, but I don't think that would be causing this error? I remember it coming up during testing without that, too. I will look at the Spring project as soon as I can, thank you for your help so far!