In this blog post I want to point out that I just created a 12 min YouTube video related to the great Hands-on workshop: Reactive Endpoints with Quarkus on OpenShift. In this video you can watch and follow the steps of the exercise 2 “Develop reactive Endpoints”. Niklas wrote a great blog post about the topic of that exercise. This is the name and link of his blog post Developing reactive REST APIs with Quarkus.
Let me give you a short preview of the exercise 2 “Develop reactive Endpoints”.
In that exercise we will start to implement our own My Web-API Microservice. The image below contains a simplified architecture overview of the sample Microservices application and points to a simplified class diagram of the six classes, which will be implemented during the next two exercises.
In exercise 4 we will use the Java functionality CompletionStage and CompletableFuture for the asynchronous implementations of the reactive endpoint.
The gif below shows the relevant flow (a bit simplified) for the Endpoint implementation. I use a sequence diagram and code in a combination for an easier understanding.
- Steps 1, 2 and 3: Invoke the asynchronous reactive REST API and return a CompletableFuture as CompletionStage
- Steps 4, 5, 6 and 7 Doing all the needed work in a chain of steps:
- get the articles data
- map the data
- complete the CompletionStage for the CompletableFuture.
I hope this was useful for you and let’s see what’s next?
PS: You can try out Cloud Foundry Apps or Kubernetes on IBM Cloud. By the way, you can use the IBM Cloud for free, if you simply create an IBM Lite account. Here you only need an e-mail address.
#IBMDeveloper, #IBMCloud, #OpenShift, #Java #reactive #CompletionStage #CompletableFuture
Leave a Reply