Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Practical Cloud-Native Java Development with MicroProfile

You're reading from  Practical Cloud-Native Java Development with MicroProfile

Product type Book
Published in Sep 2021
Publisher Packt
ISBN-13 9781801078801
Pages 404 pages
Edition 1st Edition
Languages
Authors (5):
Emily Jiang Emily Jiang
Profile icon Emily Jiang
Andrew McCright Andrew McCright
Profile icon Andrew McCright
John Alcorn John Alcorn
Profile icon John Alcorn
David Chan David Chan
Profile icon David Chan
Alasdair Nottingham Alasdair Nottingham
Profile icon Alasdair Nottingham
View More author details

Table of Contents (18) Chapters

Preface 1. Section 1: Cloud-Native Applications
2. Chapter 1: Cloud-Native Applications 3. Chapter 2: How Does MicroProfile Fit into Cloud-Native Application Development? 4. Chapter 3: Introducing the IBM Stock Trader Cloud-Native Application 5. Section 2: MicroProfile 4.1 Deep Dive
6. Chapter 4: Developing Cloud-Native Applications 7. Chapter 5: Enhancing Cloud-Native Applications 8. Chapter 6: Observing and Monitoring Cloud-Native Applications 9. Chapter 7: MicroProfile Ecosystem with Open Liberty, Docker, and Kubernetes 10. Section 3: End-to-End Project Using MicroProfile
11. Chapter 8: Building and Testing Your Cloud-Native Application 12. Chapter 9: Deployment and Day 2 Operations 13. Section 4: MicroProfile Standalone Specifications and the Future
14. Chapter 10: Reactive Cloud-Native Applications 15. Chapter 11: MicroProfile GraphQL 16. Chapter 12: MicroProfile LRA and the Future of MicroProfile 17. Other Books You May Enjoy

Chapter 3: Introducing the IBM Stock Trader Cloud-Native Application

Throughout this book, we'll be using an example application known as IBM Stock Trader to demonstrate various concepts and techniques. This open source example is intended to show people how to develop, deploy, and use a typical cloud-native application that is composed of various microservices and leverages various external services such as databases, messaging systems, and internet services. All microservices are containerized and deployed (via an operator) to a Kubernetes cluster such as the OpenShift Container Platform.

As the name implies, the IBM Stock Trader example exists in the financial domain, simulating a brokerage application that tracks the stocks each customer has purchased in their portfolio. While it doesn't actually buy or sell anything, it does look up current actual prices of specified stocks and computes an overall portfolio value that maps to a customer loyalty level. It also simulates...

Overview of the IBM Stock Trader application

Created and enhanced over the past 3-4 years, this polyglot example demonstrates how to create containerized microservices, targeting a variety of application runtimes. For the most part, these microservices are deliberately kept simple so that readers don't get bogged down in the deep technical intricacies that would likely exist in a real brokerage application. That said, it is very much intended to be significantly more instructive than the various Hello World-level examples often shown in beginners' documentation for cloud-native programming.

The example consists of about a dozen microservices that interact with about a dozen external dependencies (most of which are optional). There is also a Helm chart and an OpenShift operator (which wraps the Helm chart) used for deployment of the example, which will be covered in Chapter 9, Deployment and Day 2 Operations.

In this section, we will provide a high-level overview of...

Mandatory microservices and external services

As mentioned earlier, the core part of the example is just that which is needed to do the basics of creating portfolios and buying/selling stock. Those parts of the example have a solid border around each box, as shown in Figure 3.3.

The following subsections will describe each of the microservices and their dependencies that are required in order to exercise the primary functionality of the IBM Stock Trader application—that is, the ability to create portfolios and buy and sell stocks within them.

Trader

Trader is the standard UI client for the example. As seen earlier in Figure 3.1, it presents a list of existing portfolios, allowing you to create new ones, update existing ones (by buying or selling stocks), and delete portfolios. It communicates, via REST service calls, with the Broker microservice, passing a JavaScript Object Notation (JSON) Web Token (JWT) for single-sign-on (SSO) purposes.

It is implemented via a...

Optional microservices and external services

There are also several optional parts of the example that you would only set up if you wanted certain extra bells and whistles available (such as having it send a tweet when you level up from SILVER to GOLD). Those parts have a dashed border in the architectural diagram.

Most people setting up the example skip many (or sometimes all) of the following pieces in the interest of simplicity. But each of these demonstrates how to do some additional things in a cloud-native manner, so they serve as good examples of how to utilize additional Java Enterprise Edition (EE)/Jakarta EE and MicroProfile technologies.

In this section, we will take a look at each of these optional microservices and their dependencies. The first of these is the alternate UI we saw earlier.

Tradr

The more attractive UI is called Tradr. Its source code (the only non-Java microservice in the example) is a bit more complicated to read, but it provides a much more...

Summary

You should now have a feel for the cloud-native example that will be used throughout this book. Though it may appear a bit daunting at first, the mandatory parts are quite easy to set up (especially if you use the pre-built images in Docker Hub), so you can be up and running with the basics of the example in a matter of minutes. Then, you can add whichever of the optional bonus capabilities you'd like at your own pace.

In the upcoming chapters, various MicroProfile technologies will be discussed in detail. Each will show snippets from particular microservices in this example. As you have seen, different microservices are meant to demonstrate different features of Jakarta EE and MicroProfile and provide a real running tutorial of how to integrate with various external services.

In Chapter 8, Building and Testing your Cloud-Native Application we'll examine how these microservices were developed so that you can learn how to develop such microservices yourself....

lock icon The rest of the chapter is locked
You have been reading a chapter from
Practical Cloud-Native Java Development with MicroProfile
Published in: Sep 2021 Publisher: Packt ISBN-13: 9781801078801
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}