Chapter 7. Discovering microservices for consumption

 

This chapter covers

  • Why service discovery is important
  • How to register a microservice so it can be discovered by clients
  • Which service registries are supported by Thorntail
  • How to look up a microservice within a client

As part of decomposing pieces of the Cayambe monolith into separate microservices, you’ve decided that you need a service for processing order payments. This new microservice will then be used within the Cayambe monolith in chapter 10.

Dozens, if not hundreds, of providers offer payment processing services. Initially, you’ll develop basic integration with Stripe (https://stripe.com/docs/quickstart). To facilitate future expansion of payment providers, you’ll integrate with Stripe in its own microservice. The new payment microservice will then use the Stripe microservice to process and record the payment with the Stripe online service.

In previous chapters, you’ve seen how to access separate microservices directly by referring to the URL where a microservice is running. In this chapter, you’ll take calling microservices a step further by decoupling your client from the microservice it’s consuming, making it easier to scale.

7.1. Why does a microservice need to be discovered?

7.2. Registering a microservice with Thorntail

7.3. Consuming a registered microservice with Thorntail

Summary