Hands-On Cloud-Native Microservices with Jakarta EE

Book Description

Discover how cloud-native microservice architecture helps you to build dynamically scalable applications by using the most widely used and adopted runtime environments

Key Features

  • Build robust cloud-native applications using a variety of tools
  • Understand how to configure both Amazon Web Services (AWS) and Docker clouds for high availability
  • Explore common design patterns used in building and deploying microservices architecture.

Book Description

Businesses today are evolving rapidly, and developers now face the challenge of building applications that are resilient, flexible, and native to the cloud. To achieve this, you'll need to be aware of the environment, tools, and resources that you're coding against.

The book will begin by introducing you to cloud-native architecture and simplifying the major concepts. You'll learn to build microservices in Jakarta EE using MicroProfile with Thorntail and Narayana LRA. You'll then delve into cloud-native application x-rays, understanding the MicroProfile specification and the implementation/testing of microservices. As you progress further, you'll focus on continuous integration and continuous delivery, in addition to learning how to dockerize your services. You'll also cover concepts and techniques relating to security, monitoring, and troubleshooting problems that might occur with applications after you've written them.

By the end of this book, you will be equipped with the skills you need to build highly resilient applications using cloud-native microservice architecture.

What you will learn

  • Integrate reactive principles in MicroProfile microservices architecture
  • Explore the 12-factors-app paradigm and its implications
  • Get the best out of Java versions 8 and 9 to implement a microservice based on Thorntail
  • Understand what OpenShift is and why it is so important for an elastic architecture
  • Build a Linux container image using Docker and scale the application using Kubernetes
  • Implement various patterns such as, Circuit Breaker and bulkheads
  • Get to grips with the DevOps methodology using continuous integration (CI) and continuous deployment (CD)

Who this book is for

This book is for developers with basic knowledge of Java EE and HTTP-based application principles who want to learn how to build, test and scale Java EE microservices. No prior experience of writing microservices in Java EE is required.

Publisher Resources

Download Example Code

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Cloud-Native Microservices with Jakarta EE
  3. Contributors
    1. About the authors
    2. About the reviewer
    3. Packt is searching for authors like you
  4. About Packt
    1. Why subscribe?
    2. Packt.com
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Jakarta EE - the New Open Source Life of Java EE
    1. Open source
    2. The Java programming language
      1. Sun Microsystems
      2. Oracle Corporation
      3. Eclipse Foundation
    3. OpenJDK 9 and 10 – key features for cloud environments
      1. JDK 9
      2. JDK 10
    4. Java EE – MicroProfile.io – Jakarta EE
      1. MicroProfile
      2. Jakarta EE
    5. Summary
  7. Microservices and Reactive Architecture
    1. MicroProfile and the principles of MSA
      1. What are microservices?
      2. Benefits of microservices
      3. Drawbacks of microservices
    2. SOA versus MSA
      1. Differences between MSAs and SOAs
    3. From monolith to microservices
      1. What is a monolith?
      2. Migration path
    4. Reactive systems and reactive programming
      1. Reactive systems
      2. Reactive programming
        1. RxJava
        2. Spring WebFlux and reactive stacks
        3. Vert.x
      3. Reactive Java EE monolith
        1. Asynchronous processing
        2. Messaging communications
    5. Summary
  8. Cloud-Native Applications
    1. Twelve-factor applications
      1. Code base
      2. Dependencies
      3. Config
      4. Backing services
      5. Build, release, run
      6. Processes
      7. Port binding
      8. Concurrency
      9. Disposability
      10. Development/production parity
      11. Logs
      12. Admin processes
      13. Security
    2. Microservices
    3. Runtime environments
      1. Spring Boot
      2. Thorntail
      3. Vert.x
        1. Verticles
        2. Event bus
    4. Summary
  9. Building Microservices Using Thorntail
    1. Thorntail
    2. Fractions
    3. Flexible configuration
    4. Building a fantasy football application
    5. The football player microservice
      1. Database installation and configuration
        1. Creating the source code
          1. Entity class – JPA
          2. RESTful web service – JAX-RS and CDI
      2. The football manager microservice
        1. Database installation and configuration
        2. Creating the source code
          1. Entity class – JPA
          2. RESTful web service – JAX-RS and CDI
      3. The football team microservice
        1. Database installation and configuration
        2. Creating the source code
      4. The user interface microservice
        1. Building a user interface
    6. Summary
  10. Eclipse MicroProfile and Transactions - Narayana LRA
    1. Transactions
      1. ACID properties
      2. Transaction managers
        1. JTA
        2. JTS
      3. Extended architecture
        1. Consensus protocol
          1. 2PC protocol
          2. 3PC protocol
        2. The Paxos consensus
    2. Transactions in microservices architecture
    3. The saga pattern
    4. Saga implementations
      1. The Axon framework
        1. Eventuate
        2. Eventuate ES
        3. Eventuate Tram
    5. MicroProfile LRA
      1. The football market microservice
        1. LRA coordinator
        2. Football-player-microservice-lra
        3. Football-player-offer-microservice-lra
        4. Football-player-market-microservice-lra
          1. Initialize
          2. The LRA business method
          3. The complete phase
          4. The compensate phase
          5. Football_Player_Market_client
      2. Limitations
    6. Summary
  11. Linux Containers
    1. Linux Containers
      1. Cgroups
      2. Namespaces
      3. SELinux
    2. Containers
    3. Docker
    4. football-player-microservice
    5. football-player-ui
    6. Kubernetes
    7. Summary
  12. Platform as a Service
    1. An introduction to OpenShift
      1. OpenShift for developers
      2. OpenShift for operations
    2. OKD
      1. Installing OKD
      2. The OpenShift client
      3. Managing a local OpenShift cluster
    3. Templates
    4. Networking
      1. Services
      2. Routes
    5. Monitoring
    6. Summary
  13. Microservices Patterns
    1. Decomposition
      1. How do you decompose an application?
        1. By functionality
        2. By integration
        3. By resource consumption
        4. Serverless 
    2. API gateway
    3. Bulkhead
    4. Circuit breaker
      1. Istio
    5. Sidecar
    6. Summary
  14. Deployment
    1. Continuous integration and continuous delivery
      1. What's the difference between CI, CD, and CD?
    2. Blue-green deployment
    3. Canary deployment
    4. A/B testing deployment
    5. Rolling deployment
    6. Summary
  15. Monitoring
    1. Prometheus
      1. Installing Prometheus
    2. Node-exporter
      1. Installing Node-exporter
    3. Grafana
      1. Installing Grafana
    4. Summary
  16. Building Microservices Using Spring Boot 2
    1. Spring Boot
      1. Maven settings
      2. Gradle settings
      3. Upgrading from an earlier version of Spring Boot
    2. Building Spring Boot microservices
      1. Project details
        1. Database installation and configuration
        2. Creating the source code
          1. Entity class – JPA
          2. Repository – JPA
          3. The RESTful web service
          4. Swagger documentation and OpenAPI
  17. Building Microservices Using Vert.X
    1. Vert.x
      1. Maven settings
      2. Gradle settings
    2. Building a football player microservice
      1. Project details
        1. Database installation and configuration
        2. Creating the source code
          1. The data access layer
          2. The RESTful web service
        3. Creating the test code
    3. The football player microservice – Vert.x + RxJava
  18. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product Information

  • Title: Hands-On Cloud-Native Microservices with Jakarta EE
  • Author(s): Luigi Fugaro, Mauro Vocale
  • Release date: January 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781788837866