Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Cloud Development with WildFly

You're reading from   Hands-On Cloud Development with WildFly Develop, deploy, and configure cloud-based, enterprise Java applications with WildFly Swarm and OpenShift

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher Packt
ISBN-13 9781786462374
Length 310 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Tomasz Adamski Tomasz Adamski
Author Profile Icon Tomasz Adamski
Tomasz Adamski
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Java EE and Modern Architectural Methodologies FREE CHAPTER 2. Getting Familiar with WildFly Swarm 3. Right-Sizing Your Services 4. Tuning the Configuration of Your Services 5. Testing Your Services with Arquillian 6. Deploying Applications on the Cloud with OpenShift 7. Configuring Storage for Your Applications 8. Scaling and Connecting Your Services 9. Configuring Continuous Integration Using Jenkins 10. Providing Security Using Keycloak 11. Adding Resilience Using Hystrix 12. Future Direction 13. Other Books You May Enjoy

The goal of the book

As you are going to learn in this book, you are able to use your existing Java EE knowledge to create microservices architecture. This knowledge will not be sufficient though, because, as we mentioned in the Microservices section, this kind of architecture introduces its own complexity, which has to be handled.

The goal of this book is to fill this knowledge gap by providing you with a practical, hands-on introduction to the development of microservice-based applications running on cloud infrastructures. This book makes an assumption that you are familiar with Java EE and the traditional way of developing Java EE applications. It will complement this knowledge with the information about a concrete set of tools that will allow you to immediately take advantage of both cloud computing and microservices.

We will like to emphasize that this book does not advertise any particular methodology, and, as we mentioned in the Microservices section, any architecture decision should be made with regard to the concrete project, taking into consideration all the advantages and disadvantages. Our goal is to provide you with a set of tools so that if you decide to make such a transition, you will immediately know what to do.

Throughout the book, we will develop a sample application, which will serve as a base for all our examples. Let's learn more about it now.

The pet store application

Computer programming books often start with the Hello World application. Similarly, books describing a framework often develop a pet store application. We will follow this tradition. The pet store that we will develop will be a simple application that will allow you to browse the catalog of pets, add some of them to your cart, and finalize the payment.

During the development of the application, we will be concentrating on cloud and microservice aspects. The service code is simple and uses basic Java EE technologies so that the reader can concentrate on what is being taught in this book: cloud integration and microservices development.

Let's take the bird's-eye view of the application:

The backend services (red), gateways (yellow), and security server (blue) are deployed in a cloud. The UI application (green) is deployed outside the cloud.

The gateway services are responsible for providing APIs for different users. The customer gateway provides an API for customers, which is used by petstore-ui—web-client implementing the store interface. The customer gateway orchestrates invocations to the underlying base services and is accessible from outside the cloud.

The security service is responsible for the authentication and authorization of access to different parts of the API. It is used by all other components. The security service is accessible from outside the cloud.

The core functionalities are implemented by backend services. Backend services are not accessible from the gateway service. Let's take a look at their functions:

  • Catalog service: Provides information about pets available in the store
  • Pricing service: Responsible for providing the price of a given pet
  • Cart service: Responsible for keeping information about the cart of a given customer

We will develop the application step by step throughout the book. The application is attached to the book, and as a result, you could work with it immediately while learning various concepts described in the book.

The technologies used

We will convert our traditional Java EE JARs into runnable ones using WildFly Swarm—the tool that we will introduce in Chapter 2, Get Familiar with WildFly Swarm. WildFly Swarm is able to wrap our application into a JAR containing a minimal number of libraries needed for it, effectively creating microservices from a deployable JAR. We will cover how Swarm does it in Chapter 3, Right-Size Your Applications, and how to configure the created services in Chapter 4, Tuning the Configuration of Your Services.

After services are written, we have to write tests for them. We will use the Arquillian library to do it. We will discuss how to use it in Chapter 5, Testing Your Services with Arquillian.

We will deploy the created services in cloud using OpenShift. In Chapter 6, Deploying Applications on the Cloud with OpenShift, we will give you a theoretical introduction to the platform, the API, and tools that it provides. In Chapter 7, Configuring Persistent Storage for your Applications, we will discuss how to configure persistent storage for our applications on OpenShift and how to scale and connect our services.

Creating and deploying applications in cloud is not enough for them to be ready for production. We still need to secure them, monitor them, and take care of network failures.

To provide security, we will take advantage of the Keycloak server. In order to take care of network failures, we will use the Hystrix library. In order to provide monitoring.

You have been reading a chapter from
Hands-On Cloud Development with WildFly
Published in: Mar 2018
Publisher: Packt
ISBN-13: 9781786462374
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 $19.99/month. Cancel anytime
Banner background image