Skip to Content
Implementing Modern DevOps
book

Implementing Modern DevOps

by David Gonzalez, Danny Varghese
October 2017
Intermediate to advanced
326 pages
7h 20m
English
Packt Publishing
Content preview from Implementing Modern DevOps

Aggregator service

The aggregator service is the microservice that, as the name indicates, aggregates the other two (or more) services and provides a front API for consumers so that all the logic behind the scenes gets encapsulated. Even though it is not perfect, this is a common pattern because it allows us to play with the idea of circuit breaking as well as manage the errors on a dedicated layer.

In our case, the service is quite simple. First, let's take a look at the code:

const Hapi = require('hapi') const server = new Hapi.Server() let request = require('request') server.connection({port: 8080}) server.route({ method: 'GET', path: '/dates/{timestamp}', handler: (req, reply) => { const utcEndpoint = `http://utcdate-service:3001/utcdate/${req.params.timestamp}` ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical DevOps

Practical DevOps

joakim verona
Hands-On Security in DevOps

Hands-On Security in DevOps

Tony Hsiang-Chih Hsu
SRE with Java Microservices

SRE with Java Microservices

Jonathan Schneider

Publisher Resources

ISBN: 9781786466877Supplemental Content