WebSockets Support for Java
WebSockets Support for Java
The platform supports WebSockets through the Shared Load Balancer, NGINX load balancer, and all available Java application servers. Most Java servers require only application-level implementation; GlassFish additionally requires server-side activation.
Create a Java Environment
1Open the environment wizard
Sign in to the platform dashboard and click New environment.
2Select GlassFish
Open the Java tab, select GlassFish, define the vertical scaling limits with the Cloudlet sliders, enter an environment name such as java-websockets, and click Create.
Wait until the environment is created and the GlassFish node reaches the running state.
Deploy the WebSocket Application
Deploy the Java application that requires WebSocket support to the GlassFish environment.
- Upload a local application archive.
- Deploy the application from a remote URL.
- For a remote VCS repository, add a Maven build node and use the Java VCS deployment workflow.
After deployment, the application is listed in the environment’s deployed-project column.
Open the GlassFish Admin Console
1Open the Admin Panel
Click the GlassFish Additionally button and select Admin panel > Login. The console can also be opened through the direct link sent by email after environment creation.
2Sign in
Enter the GlassFish administration credentials provided in the environment-creation email and click Login.
Enable WebSockets Support
1Open the HTTP listener settings
In the GlassFish Administration Console, navigate to:
Configurations > gfcluster-config > Network Config > Protocols > http-listener-1
2Enable WebSockets
Open the HTTP tab, select the WebSockets Support checkbox at the bottom of the page, and click Save.
Restart and Test GlassFish
1Restart GlassFish
Return to the platform dashboard and restart the GlassFish node to apply the WebSocket configuration.
After GlassFish returns to the running state, open the deployed application in a browser and verify that its WebSocket functionality works correctly.
