Web Sockets deprecated
Web Sockets documentation
With Open-Xchange Middleware version 7.8.3 Web Socket connections are supported. A Web Socket connection is only allowed to be established for a fully authenticated session. Hence, a HTTP Upgrade request is required to pass all the validating and verifying steps as for regular HTTP requests in order to establish a Web Socket connection.
Moreover, a Web Socket connection is cluster-wide registered. Thus a message created on cluster member A reaches possible open Web Sockets on cluster member B.
For a comprehensive guide to setup up mail push, please see here
Prerequisites
In order to use Web Socket transport the /socket.io
servlet needs to be accessible by clients. If you are using the App Suite stack chart, the servlet is automatically exposed.
Please note: As a Web Socket is made cluster-wide accessible, Redis is used to manage the orchestration and management of Web Sockets in the cluster.
Configuration
Enable the
open-xchange-websockets-grizzly
package:core-mw: packages: status: open-xchange-websockets-grizzly: enabled
Enable the com.openexchange.websockets.enabled property. That property is responsive to config-cascade. Hence it can be specified for user, context, context-set or server scope. For instance, create file
websockets.properties
in Open-Xchange configuration directory (/opt/open-xchange/etc
) and add linecom.openexchange.websockets.enabled=true
to globally enabled Web Sockets.
Enable/Disable
As already outlined above, the config-cascade-aware property com.openexchange.websockets.enabledcontrols whether a Web Socket is allowed to be created for a certain user.
Remote communication
The following settings control buffering and queueing of Web Socket messages that are supposed to be transferred to a remote cluster member:
- com.openexchange.websockets.grizzly.remote.delayDuration
The time in milliseconds a message (that is supposed to be transferred to a remote cluster member) is queued in buffer to await equal message that arrive during that time.
Default 1000ms - com.openexchange.websockets.grizzly.remote.maxDelayDuration
The time in milliseconds a "remote" message is at max. queued in buffer to await equal message that arrive during that time. So, even is there was an equal message recently, message is flushed from queue to avoid holding back a message forever in case there are frequent equal messages.
Default 3000ms - com.openexchange.websockets.grizzly.remote.timerFrequency
The frequency/delay in milliseconds when the buffering queue will be checked for due "remote" messages (the ones exceeding delayDuration in queue).
Default 500ms
These settings are not config-cascade-aware, but reloadable.