0

I'm still fighting with a proper configuration of WebSockets in Vaadin 23 application and NGINX.

For NGINX I configured the following:

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";

proxy_read_timeout     300;
proxy_connect_timeout  300;
proxy_send_timeout     300;
reset_timedout_connection  on;

I also tried 600(10m) instead of 300. The same issue.

For Vaadin application:

@Push(transport = Transport.WEBSOCKET_XHR) 

vaadin.heartbeatInterval=300
vaadin.maxMessageSuspendTimeout=5000

Everything works relatively well on my computer. Most of the issues I may see on my iPhone - for example after being idle for a while - I click the button with @Async ListenableFuture logic, and may only see the progress bar I showed before:

progressBar.setVisible(true);
ListenableFuture listenableFuture = //some async method call
var ui = UI.getCurrent();
listenableFuture.addCallback(result -> {
            ui.access(() -> {
               // some UI updates
               progressBar.setVisible(false);
            });
        }
    }, err -> {
        logger.error("Error", err);
    });

block.

After that I don't see any issues in my NGINX/Tomcat error logs.. nothing. I just see a browser with an infinitive ProgressBar. But if I refresh the page - everything starts working properly again.

So, I'm trying to figure out what could be wrong and how Vaadin is supposed to detect a failed WS connection and recover it. What properties are responsible for this and how quickly it can be done. Could you please help me with this?

Also, is there any correlation between vaadin.heartbeatInterval and WebSockets ? And do I need to specify vaadin.pushLongPollingSuspendTimeout in case of Transport.WEBSOCKET_XHR ?

alexanoid
  • 24,051
  • 54
  • 210
  • 410

0 Answers0