@Push with WebComponentExporter

Hi All,

I’m trying to implement updating the UI from another thread (which I’ve done before) however this time it is on a Exported Component in my Micro Services environment. If I add the @Push annotation to the WebComponentExporter class, although the application shows up looking how it should, it doesn’t respond to any interaction, i.e. button clicks are ignored. (there is no network requests at all).

If I remove the annotation, its back to normal, but I loose the push functionality.

Vaadin 14.4.1

Any suggestions?

Thanks,

Stuart.

Can you debug using the browser and see what’s happening when the buttons are pressed? Is there an error in the browser’s console?

Hi Olli,

I’ll check, but I’m just upgrading to version 17 (which isn’t working at the moment), once that is running I’ll get back to you.

Thanks!!

Stuart.

Hi Olli,

So I’ve had a look at the console whist in @Push mode. All I get this the following warning: (no errors, no network activity)

client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:885 Trying to invoke method on not yet started or stopped application
zt @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:885
qt @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:522
mt @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:719
nt @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:328
ov @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:530
Hx @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:754
yx @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:616
Nw @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:1011
Zw @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:203
Cy @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:1027
LC @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:556
(anonymous) @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:714
sb @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:436
vb @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:888
(anonymous) @ client-C4B53966888EAB6CBD0D20BD246409CB.cache.js:623

Stuart

Ok, it was an issue with the websocket connection. My Dev environment bounces the connections via a Apache server though a SSH tunnel. (So I can let people view my live dev env without me having to deploy it anywhere.)

So the issue was the websocket wasn’t being passed thought the SSH tunnel. So I added a rewrite rule to fix said issue :slight_smile:

  RewriteEngine On
  RewriteCond %{QUERY_STRING} transport=websocket    [NC]

  RewriteRule /(.*)           ws://localhost:1802/$1 [P,L]

Edit: to add, my web server has SSL enabled, so it may have been trying to pass wss:// to my application, hence the need to rewrite it to ws://

Cheers,

Stuart