Preface
The mission of the book is to make you familiar with the tools that you can use to develop and deploy Java EE applications in the cloud. You will be led through the whole application development process: creating the application, deploying in the cloud, configuring Continuous Integration, and secure and fault-tolerant communication between the created services. As a result, you will gain practical knowledge of Java EE cloud development, which you can use as a reference for your further projects.
Who this book is for
If you're an experienced developer who's familiar with Java EE technologies and would like to learn how you can use those technologies in the cloud with WildFly and OpenShift, then this book is for you.
What this book covers
Chapter 1, Java EE and Modern Architectural Methodologies, gives users an overview of the current state of Java EE and its relevance to modern architectural methodologies, that is, microservices and cloud computing. We will introduce the tools that will be used throughout the book and the application that we will be developing.
Chapter 2, Getting Familiar with WildFly Swarm, covers WildFly and how it relates to Java EE and its main features. We will introduce WildFly Swarm—WildFly's side project—describe its purpose, and show how it can be used to develop microservices.
Chapter 3, Right-Sizing Your Services, focuses on what Swarm does to create your services with only those dependencies that are necessary for them. You will learn in greater detail what a fraction is, how Swarm detects which fractions should be used, and how you can modify the fraction discovery behavior.
Chapter 4, Tuning the Configuration of Your Services, helps you to learn how to configure your Swarm services. We will show you practical examples of different configuration tools that are available and how you can use them to steer the behavior of your applications.
Chapter 5, Testing Your Services with Arquillian, teaches you how to test your microservices. This chapter will introduce Arquillian, the testing framework that will be used, and present the purpose of the project and its main features. Later, you will learn how to develop, write, and configure tests for your services based on practical examples.
Chapter 6, Deploying Applications on the Cloud with OpenShift, discusses how to deploy those services to the cloud, and this chapter uses OpenShift to achieve that.
Chapter 7, Configuring Storage for Your Applications, starts by helping you learn the theoretical basis of OpenShift storage configuration. Later, we will show you how to deploy a database in the cloud and configure your cloud applications to use it.
Chapter 8, Scaling and Connecting Your Services, looks in greater detail at the process of deploying, scaling, and connecting your applications running in an OpenShift environment.
Chapter 9, Configuring Continuous Integration Using Jenkins, teaches you how to integrate the pet store application with Jenkins, a Continuous Integration server. We will introduce CI concepts and show how they can be implemented using Jenkins.
Chapter 10, Providing Security Using Keycloak, deals with the basics of distributed, token-based security. We will introduce Keycloak, an authentication server, that can be used to secure distributed cloud applications. As a practical example, we will secure part of the API of the Petstore application.
Chapter 11, Adding Resilience Using Hystrix, discusses how to deal with network failures, which are inevitable in a distributed environment. In order to do that, we will introduce the circuit breaker architectural pattern and cover when it should be used and what are its benefits. We will look at its Netflix implementation, Hystrix. We will cover how it is implemented and how it can be used.
Chapter 12, Future Direction, describes briefly what the future of Java EE development is likely to look such as, the plans for evolving the platform and how concepts provided by applications described in the book may be standardized in the future. We will also take a look at MicroProfile and Jakarta EE, describe their purpose, and emphasize how they can help you to move the platform forward at a faster pace.
To get the most out of this book
This book assumes that you are familiar with Java EE technology. Although we will be briefly reminding what Java EE constructs do in the examples, they won't be explained in detail.
The code repository contains the examples from all the chapters. In order to help you navigate through them, the examples are indexed from within the chapters.
Download the example code files
You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
- Log in or register at www.packtpub.com.
- Select the
SUPPORT
tab. - Click on
Code Downloads & Errata
. - Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
- WinRAR/7-Zip for Windows
- Zipeg/iZip/UnRarX for Mac
- 7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-On-Cloud-Development-with-WildFly. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here:
Conventions used
There are a number of text conventions used throughout this book.
CodeInText
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Computer programming books often start with a Hello World
application."
A block of code is set as follows:
package org.packt.swarm; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces;
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
package org.packt.swarm;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath("/")
public class HelloWorldApplication extends Application {
}
Any command-line input or output is written as follows:
mvn wildfly-swarm:run
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "we have to click on the Create a route
in Services
menu of the web console."
Note
Warnings or important notes appear like this.
Note
Tips and tricks appear like this.
Get in touch
Feedback from our readers is always welcome.
General feedback: Email [email protected]
and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected]
.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected]
with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Reviews
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packtpub.com.