Learning Library

← Back to Library

Open Liberty Microservices Game Demo

Key Points

  • The episode introduces a demo application built with Open Liberty that combines a gesture‑controlled tabletop game with a full microservices backend.
  • The project migrated from legacy Java EE to Jakarta EE after the Eclipse Foundation took stewardship, making the stack fully open source.
  • Core services—including the game logic, a leaderboard, and a UI—are each deployed as separate Open Liberty microservices, illustrating a modular architecture.
  • Using MicroProfile APIs on top of Jakarta EE provides cloud‑native features (such as fault tolerance and health checks) that simplify development and integration of diverse components.
  • Operational visibility is achieved with Prometheus for metrics collection and Grafana for real‑time dashboards, showcasing best‑practice observability in a microservices environment.

Full Transcript

# Open Liberty Microservices Game Demo **Source:** [https://www.youtube.com/watch?v=bURqsxP5gEY](https://www.youtube.com/watch?v=bURqsxP5gEY) **Duration:** 00:07:07 ## Summary - The episode introduces a demo application built with Open Liberty that combines a gesture‑controlled tabletop game with a full microservices backend. - The project migrated from legacy Java EE to Jakarta EE after the Eclipse Foundation took stewardship, making the stack fully open source. - Core services—including the game logic, a leaderboard, and a UI—are each deployed as separate Open Liberty microservices, illustrating a modular architecture. - Using MicroProfile APIs on top of Jakarta EE provides cloud‑native features (such as fault tolerance and health checks) that simplify development and integration of diverse components. - Operational visibility is achieved with Prometheus for metrics collection and Grafana for real‑time dashboards, showcasing best‑practice observability in a microservices environment. ## Sections - [00:00:00](https://www.youtube.com/watch?v=bURqsxP5gEY&t=0s) **Open Liberty Game Demo** - In this segment, host Dan introduces Open Liberty developer Harry Hoots, who explains a gesture‑controlled microservice game built with Jakarta EE and a suite of open‑source technologies. - [00:03:05](https://www.youtube.com/watch?v=bURqsxP5gEY&t=185s) **Websocket-Controlled Rover Game Architecture** - The speaker outlines a system where player gestures are sent via bi‑directional websockets to a game service that routes commands to an Arduino‑powered rover, whose RFID/NFC sensors report damage back through REST APIs to the UI and leaderboard, demonstrating the benefits of separating functionality into microservices. - [00:06:14](https://www.youtube.com/watch?v=bURqsxP5gEY&t=374s) **Extending IoT with Microservices** - The speaker highlights how microservice architecture enhances IoT projects and directs viewers to Open Liberty resources, a Space Rover GitHub repo, and calls for engagement. ## Full Transcript
0:00Welcome to Tech Talk! 0:01Today's topic is Open Liberty. 0:03For those that follow this channel, you may have seen my video on cloud-native Java and 0:07how it helps enterprise developers extend their investment in tools and skills into the future. 0:12Well, today we're joined by Harry Hoots, one of the developers from Open Liberty. 0:16He's going to show us how they implemented a fun demo that knits together lots of technologies 0:20using Open Liberty and a host of other open source projects. 0:24For those who haven't seen the game, the way it works is that you have a play table, which 0:28is with some planets and obstacles. 0:31The players use hand gestures that are detected by a camera to navigate the game board. 0:35They have a fixed amount of time and they have to avoid taking on damage on the way 0:39to a destination planet. 0:42That's the game itself. 0:43This topology diagram shows the different microservices that it uses on the back end, 0:48as well as a web server on the front end. 0:50With that intro out of the way, Harry, can you explain how this Java EE project got started 0:55and what were your goals? 0:56Sure Dan! 0:57One little correction up front though. 0:59So instead of Java EE, it's now Jakarta EE. 1:01Java EE was Oracle's and they gave that over to the Eclipse Foundation around the end of 2017, beginning of 2018. 1:08So now it's controlled by them as an open source project to gives you Java EE functionality. 1:12Well, I've been around a little longer, 1:14so thank you for that historical note. 1:16You're welcome. 1:17All right. 1:18So if you want to know more about the game service. 1:20So, first off, we have the game service itself, which is basically the brainchild behind all this. 1:27We also --and it runs on Open Liberty --we've also got the leaderboard service; again, an 1:32Open Liberty service. 1:34We've got Prometheus and Grafana servers so that we can scrape metrics and display them 1:39on a dashboard. 1:40We also have a front-end UI where the user walks up and types in their name and sees 1:45their score, that kind of thing. 1:47So you divided this into a number of different services and some other components. 1:51Why do you choose to do that? 1:52How did it help you? 1:53Yeah. 1:54So microservices architecture gives you a lot of flexibility. 1:57If you think about your typical IoT or your Java enterprise application, usually there's 2:03a lot of legacy things in there and new things. 2:05And so you want to be able to tie all those together. 2:08Microservices give you that flexibility to take pieces, different architectures, different 2:13languages, different hardware and put all those together. 2:16And so that's why we did it. 2:17We wanted to highlight a MicroProfile-- excuse me --microservices type of project that highlighted 2:25Open Liberty and using MicroProfile and Jakarta EE APIs. 2:30So MicroProfile, you mentioned that a few times [that I mentioned in the prior video-- 2:33if you haven't seen it, be sure and check it out]. 2:35Where was the payoff there for your team? 2:37Yeah. 2:38So, again, MicroProfile in Jakarta EE give users a bunch of APIs developed for cloud-native 2:46applications --streamlined, that sort of thing. 2:50It takes a lot of the time of programming from the developer and gives them back time 2:54to actually focus on the logic of the game. 2:57And speaking of the game, now that we've got the big picture, could you kind of walk us 3:01through from the user's point of view all the way through these different services. 3:05What's going on? 3:06Sure. 3:07So again, we've got web sockets that are bi-directional servers on the hardware and the game service. 3:11So when a user, for example, indicates a gesture of left, a message is sent to the game service 3:17and then it's routed over to the physical rover. 3:21So on the physical rover, the Arduino board takes that message, parses it, figures out, 3:26"Oh, it's turn left". 3:28And so then it turns the wheels and the appropriate fashion. 3:31And so that loop repeats until the player runs out of time in the game. 3:35And then throughout the gameplay, there is an RFID sensor in the rover and then on the 3:42different planets that you visit are RFID cards. 3:45And then on the obstacles, there's NFC stickers so that damage can be calculated. 3:50And so that information is fed back to the game service and again goes to the UI to see 3:54your score and damage, etc.. 3:56And these two, I presume, communicate with each other. 3:58That's correct. 3:59They communicate via REST APIs. 4:03Okay. 4:04And then on this end, same deal? 4:05That's the same thing. 4:06A REST API to the leaderboard service. 4:09So by separating this out from your microservices and Open Liberty components, you were able 4:14to have your web developer focus just on that. 4:17That's right. 4:18So that's the nice thing about microservices. 4:19Typically, you would have an individual person working on a particular service, or a small 4:24team, depending if it's a larger type service. 4:26But, for example, one person worked on the game service and the leaderboard service, 4:31another worked on the UI, another worked on the rover, another worked on the physical 4:35map board that was hardware. 4:37Now, I gather you use Prometheus for pulling statistics and showing some sort of things 4:41that the developer is interested in? 4:43We do. 4:44So Prometheus, the way we have an implemented right now, is it's pulling JVM information 4:48so we can see performance. 4:49We also have a timer there so that we can see latency between the hand gestures and 4:54the hardware. 4:55Well, speaking of latency, I imagine that the whole goal of this was to deploy this 4:58at a conference on a showroom floor. 5:01What did that deployment look like? 5:02Yeah. 5:03So, typically at a conference, WiFi is going to be terrible. 5:06So we usually run it on a local box on-prem. 5:10The beauty of it is though, we've also ran it at conferences in the cloud and you can 5:15mix and match those pieces too if you wanted to. 5:17That's the flexibility of the microservices architecture. 5:20Run a few pieces in the cloud, run a few pieces local. 5:23Just depends on your needs. 5:24That's really the hybrid cloud story, right? 5:26That's correct. 5:27And so, to kind of wrap this up: What was the stack that you used? Because there's an awful lot of components. 5:32Can you kind of summarize what they were and what they did? 5:35Sure. So let's focus on the Open Liberty. 5:37And so what Open Liberty offers is a full open source stack. 5:41So we use OpenJ9 as the JVM. We use IBM Semeru Runtimes as the SDK. 5:48Open Library sits on top of that as our Java runtime server. 5:51And then on top of that, Open Liberty implements the specifications for both Jakarta EE and MicroProfile. 5:57But for the enterprise developers who are out there watching this, they're probably wondering: 6:01How do I take the lessons you learned from this game development and apply it to a business application that they might be doing? 6:07Sure. So, again, it fits really well-- this type of thing for an enterprise application. 6:14This is an IoT implementation, but yet having this microservice architecture and having 6:20different components fits very well there. 6:22Okay. That's a great way of extending it. 6:25That is for now a wrap. 6:27Since you stayed to the end of this video, I bet you want to know more. 6:30So let me point you to a couple of great resources related to cloud-native Java, microservices, 6:34and of course Open Liberty. 6:36First, check out the GitHub repo with the Space Rover mission. 6:40You can check out the source code and see the services that Harry just covered. 6:44And if you're new to Open Liberty, you can get started quickly with their hands-on guides. 6:49They cover how to build your first microservice and then go deeper into cloud-native applications 6:53featuring MicroProfile, Jakarta EE and more. 6:57Be sure to check it out in the links below. 6:59Before you leave, be sure and leave a Like and a Subscribe. 7:02If there are other topics you'd like see on Tech Talk, be sure to also drop a comment below.