Back to Catalog

Bidirectional communication between services using Jakarta

BeginnerGuided Project

Learn how to use Jakarta WebSocket to send and receive messages between services without closing the connection.

4.5 (2 Reviews)

Language

  • English

Topic

  • Open Liberty

Skills You Will Learn

  • Java, Open Liberty, Jakarta, Websockets

Offered By

  • IBM

Estimated Effort

  • 25 minutes

Platform

  • SkillsNetwork

Last Update

  • April 29, 2024
About This Guided Project
Jakarta WebSocket enables two-way communication between client and server endpoints. First, each client makes an HTTP connection to a Jakarta WebSocket server. The server can then broadcast messages to the clients. Server-Sent Events (SSE) also enables a client to receive automatic updates from a server via an HTTP connection however WebSocket differs from Server-Sent Events in that SSE is unidirectional from server to client, whereas WebSocket is bidirectional. WebSocket also enables real-time updates over a smaller bandwidth than SSE. The connection isn’t closed meaning that the client can continue to send and receive messages with the server, without having to poll the server to receive any replies.

You’ll learn how to use the Jakarta WebSocket API to build the system service and the scheduler in the client service. The scheduler pushes messages to the system service every 10 seconds, then the system service broadcasts the messages to any connected clients. You will also learn how to use a JavaScript WebSocket object in an HTML file to build a WebSocket connection, subscribe to different events, and display the broadcasting messages from the system service in a table.

Instructors

Jakub Pomykala

Software Developer

Software Developer at IBM working on the Open Liberty content team

Read more

Gilbert Kwan

WAS software developer

I am a software developer of WebSphere Application Server, now, I am the Open Liberty guides lead. Visit this blog https://openliberty.io/blog/2021/11/25/GilbertKwan_MeetTheTeam.html if you like to know me more.

Read more

Morgan Chang

Backend Developer Intern

Backend Developer at IBM Open Liberty Content Team

Read more