Taxonomy Icon

Cloud

Make Java microservices resilient with Istio

Get the code Watch the Tech Talk

Summary

Twelve-factor apps make a strong case for designing and implementing your microservices for failure. What that means is with the proliferation of microservices, failure is inevitable, and applications should be fault-tolerant. Istio, a service mesh, can help make your microservices resilient without changing application code.

Description

Building and packaging microservices is one part of the story. Given that a highly salable and distributed microservices deployment is going to face failures at different layers, how do we make these microservices resilient and fault-tolerant? How do we enforce policy decisions, such as fine-grained access control and rate limits? How do we enable timeouts/retries, health checks, etc.? Even though some language-specific frameworks address these issues, the implementation is often framework- or language-specific. If the underlying framework or language changes, the resiliency features need to be reimplemented or ported over. And in some cases, applications also have the responsibility of implementing the code and configuration required for resiliency and fault-tolerance. A service-mesh architecture attempts to resolve these issues by extracting the common resiliency features needed by a microservices framework away from the applications and frameworks and into the platform itself. Istio provides an easy way to create this service mesh. In this developer journey, we demonstrate how to build, deploy, and connect your Java™ MicroProfile microservices, leveraging Istio service mesh. We then show how to configure and use circuit breakers, timeouts/retries, rate limits, and other advanced resiliency features from Istio without changing the application code.

Flow

flow

  1. Deploy a Java application that is configured to run in a Kubernetes Cluster.
  2. Inject Istio envoys on the application.
  3. Configure advanced Istio features for the MicroProfile and create a circuit breaker for the Cloudant database.
  4. Create a load-balancing pool with two instances of Cloudant, then use a circuit breaker to detect and eject an instance when no longer healthy.
  5. Create a timeout and retry rule for the Vote microservice connection to Cloudant.

Instructions

  1. Get and build the application code.
  2. Deploy application microservices and Istio envoys.
  3. Explore Istio resiliency features: Circuit Breakers and Fault Injection.