Heartbeat not working when Push(streaming) is enabled

Hi,

I’ve enabled Push notifications on Vaadin for delivering some messages to the UI, but, since I’ve annotated my UI class with the @Push(transport = Transport.STREAMING) annotation, the Heartbeat mechanism stopped working.

I’ve simulated a connection failure, simply killing my server, and noticing that after the first heartbeat fails, Atmosphere begin to poll, trying to reconnect to the server and preventing the heartbeat mechanism to work fine, invalidating the current page…so, if i click on a button on my UI, the loading indicator appears, and the UI stucks, never telling that there is no connection to the server.

I’ve attached to this post an image of the ‘net’ console of Firebug (the same thing happens on Chrome).

  • Vaadin 7.1.11
  • JBoss EAP 6.2.0

13538.png

No one can help me?

This issue is blocking for my project, any help would be appreciated.

Hi, could you try with Vaadin 7.2 and long polling transport, to see if it’d work better?

Hi Johannes,

already tried with 7.2.2, but still getting the same issue…should I configure somewhat specific for using long-polling?

Just @Push(transport=Transport.LONG_POLLING) should be enough.

Hmm.

In Vaadin 7.1, the client would actually always stop sending heartbeats if the server is down or returns an error. So I don’t think it was specifically push that prevented the heartbeats. In 7.2, the client should try sending heartbeats indefinitely, so if you are indeed seeing the same behavior as in 7.1, then something is wrong. What happens if you try without push? What happens when you restart the server, does Atmosphere succeed in reconnecting?

If I use setPollInterval, when the server goes down, the ‘communication error’ appears correctly on the top of the window, and, clicking the ‘click here’ link after the server has been restarted, cause the page to reload correctly

Yeah. Push tries to reconnect indefinitely - this is actually by design, although it’s not really optimal. Neither is the non-push behavior of immediately showing an error if the server is unavailable for even a moment - much better would be displaying some sort of feedback while trying to reconnect at least until some timeout. Related tickets:
#11733
,
#14378

Thanks for the Help Johannes,
so my behavior is related to an enhanchement request?

Another thing…maybe you can help me…I’ve posted another question, because I cannot make WebSocket working using JBoss EAP 6.3 (which officially supports WebSockets).

All browsers are telling me “WebSocket failed. Downgrading to comet and resending”, do you have any suggestion for make them working?
This is the link to the original question: https://vaadin.com/forum/#!/thread/8092164

Thanks for the help.