Building Reactive Microservices in Java

Book description

If you’re investigating ways to build distributed microservices, perhaps to replace an unwieldy monolithic enterprise application, this report explains the benefits of creating microservices with reactive design—a method that takes advantage of modern CPU architectures and efficient resource utilization. You’ll learn how to build effective microservice systems with Eclipse Vert.x, a toolkit for building reactive applications on the JVM.

Clement Escoffier, Principal Software Engineer at Red Hat and a Core Developer on Vert.x, shows developers and architects how to get started with this toolkit. By learning first how to build a single microservice, and then an entire system, you’ll learn the benefits of using reactive principles for building and deploying microservices that are autonomous, asynchronous, resilient, and elastic.

  • Explore the elements of reactive microservices and learn how Vert.x works
  • Build and consume a single microservice to understand how messaging improves its reactiveness
  • Create an entire microservices system, using stability and resilience patterns to manage failures
  • Use the OpenShift container platform to deploy and manage microservices in a virtual or cloud environment

Table of contents

  1. 1. Introduction
    1. Preparing Your Environment
  2. 2. Understanding Reactive Microservices and Vert.x
    1. Reactive Programming
    2. Reactive Systems
    3. Reactive Microservices
    4. What About Vert.x ?
    5. Asynchronous Development Model
    6. Verticles—the Building Blocks
    7. From Callbacks to Observables
    8. Let’s Start Coding!
      1. Project Creation
      2. Write Your First Verticle
      3. Using RxJava
      4. Packaging Your Application as a Fat Jar
      5. Logging, Monitoring, and Other Production Elements
    9. Summary
  3. 3. Building Reactive Microservices
    1. First Microservices
    2. Implementing HTTP Microservices
      1. Getting Started
      2. The Verticle
      3. HTTP Microservice
      4. Using Routes and Parameters
      5. Producing JSON
      6. Packaging and Running
    3. Consuming HTTP Microservices
      1. Project Creation
      2. Calling the Service More Than Once
    4. Are These Microservices Reactive Microservices?
    5. The Vert.x Event Bus—A Messaging Backbone
    6. Message-Based Microservices
      1. Project Creation
      2. Writing the Message-Driven Verticle
    7. Initiating Message-Based Interactions
    8. Are We Reactive Now?
      1. Elasticity
      2. Resilience
    9. Summary
  4. 4. Building Reactive Microservice Systems
    1. Service Discovery
      1. Client- and Server-Side Service Discovery
      2. Vert.x Service Discovery
    2. Stability and Resilience Patterns
      1. Managing Failures in Reactive Microservices
      2. Using Timeouts
      3. Circuit Breakers
      4. Health Checks and Failovers
    3. Summary
  5. 5. Deploying Reactive Microservices in OpenShift
    1. What Is OpenShift?
      1. Build Configuration
      2. Deployment Configurations
      3. Pods
      4. Services and Routes
    2. Installing OpenShift on Your Machine
    3. Deploying a Microservice in OpenShift
    4. Service Discovery
    5. Scale Up and Down
    6. Health Check and Failover
    7. Using a Circuit Breaker
    8. But Wait, Are We Reactive?
    9. Summary
  6. 6. Conclusion
    1. What Have We Learned?
    2. Microservices Aren’t Easy
    3. The Evolution of the Microservice Paradigm
    4. Vert.x Versatility

Product information

  • Title: Building Reactive Microservices in Java
  • Author(s): Clement Escoffier
  • Release date: June 2017
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781491986288