Server Sent Events in GAE Standard

1,805 views
Skip to first unread message

Steve Neal

unread,
Aug 6, 2018, 9:07:30 AM8/6/18
to Google App Engine

I need to send messages from the Web server to a browser based application.

Server Sent Events are an obvious choice but I cannot see any supporting documentation. Is it possible to do this with GAE standard using Java 8 ?

If not, is there a way to run web sockets, or some other technology that will allow messages to be sent to the browser. I don't want to resort to polling from the browser.

Thanks, Steve.

Steren Giannini

unread,
Aug 6, 2018, 10:21:20 AM8/6/18
to google-a...@googlegroups.com
Hi,
Server sent events are based on the HTTP protocol, so I expect them to work on App Engine.
We do not provide specific documentation, I followed this one in the past: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events
Let us know how if they work as expected for you.

Websockets are not supported on App Engine.

Steren
Product Manager

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/da54131c-b8dc-44c6-ab36-bbb918ad3125%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Barry Hunter

unread,
Aug 6, 2018, 10:39:04 AM8/6/18
to google-appengine
Well as such Server Sent Events IS long-polling!

.. it's just wrapping it up in a 'multi-part' message, but as noted its still HTTP, using Chunked encoding. 

... and a browser provided trigger mechanism to catch each new 'event' message. 




--

Steren Giannini

unread,
Aug 6, 2018, 11:19:28 AM8/6/18
to google-a...@googlegroups.com
You are correct. 
And because App Engine in automatic scaling mode has a 60 sec request timeout, this probably means that your events cannot be separated by more than 60sec.

Give it a try, let us know.

Steve Neal

unread,
Aug 6, 2018, 3:57:04 PM8/6/18
to Google App Engine

Thanks for the advice - I'll add a comment to this pwhen I've had a chance to try Server Side Events.

Attila-Mihaly Balazs

unread,
Aug 8, 2018, 12:26:26 AM8/8/18
to Google App Engine
Also, I would expect this not to work since the AppEngine instances don't talk directly to the client, but rather go trough the Google Front-end which buffers both requests and responses (so neither can be streamed).

Attila

Roxana Ioana Mirel

unread,
Aug 8, 2018, 8:13:24 AM8/8/18
to Google App Engine
On Appengine, we've been using Pusher for this, but you could also look into Firebase Cloud Messaging.

Regards,
Roxana
Reply all
Reply to author
Forward
0 new messages