- To demonstrate using exponential backoff and jitter, we're going to create a sample service in Ruby that has one simple job: to return an HTTP status that indicates a failure. In previous recipes, we've used the sinatra Ruby library to do this, so we'll continue with this, a service that simply returns a 503 HTTP status code for every request, as shown here:
require 'sinatra'get '/' do halt 503end
- Create an HTTP client using the Google HTTP client Library. First, create a new Gradle Java project with the following build.gradle file that imports the necessary libraries and plugins, as shown here:
group 'com.packtpub.microservices'version '1.0-SNAPSHOT'apply plugin: 'java'apply plugin: 'application'mainClassName = 'com.packtpub.microservices.ch05.retryclient.Main' ...