Integrating Microservices
The microservices architecture fosters building a software application as a suite of independent services. When we have to realize a given business use case, we often need to have the communication and coordination between multiple microservices. Therefor
- PDF / 1,712,096 Bytes
- 51 Pages / 504 x 720 pts Page_size
- 91 Downloads / 227 Views
Integrating Microservices The microservices architecture fosters building a software application as a suite of independent services. When we have to realize a given business use case, we often need to have the communication and coordination between multiple microservices. Therefore, integrating microservices and building inter-service communication has become the one of the most challenging tasks needed to realize the microservices architecture. In most of the existing books and other resources, the concepts of microservice integration is barely discussed or is explained in a very abstract manner. Therefore, in this chapter, we delve deep into the key challenges of integrating microservices, patterns for integrating microservices, and frameworks and languages that we can leverage.
Why We Have to Integrate Microservices Microservices are designed to address specific fine-grained business functionality. Therefore, when you are building a software application using microservices, you have to build a communication structure between these services. As discussed in Chapter 1, “The Case for Microservices,” when you are using SOA, you build a set of services (web services) and integrate them using a central bus known as an Enterprise Service Bus (ESB). As shown in Figure 7-1, with the ESB-based approach, you build business logic as part of this centralized bus as well as various network communication functions such as resilient communication (circuit breaker and timeouts) and quality of service aspects (we discuss these capabilities in detail in the latter part of the chapter).
© Kasun Indrasiri and Prabath Siriwardena 2018 K. Indrasiri and P. Siriwardena, Microservices for the Enterprise, https://doi.org/10.1007/978-1-4842-3858-5_7
167
Chapter 7
Integrating Microservices
Figure 7-1. Integrating services with ESB in SOA When you do service integration using an ESB, you will have a set of virtual services that are tightly coupled into the centralized ESB runtime. As the ESB layer grows with business and network communication logic, it becomes one gigantic monolithic application in most enterprises. This means it has all the limitations of a monolithic application that we discussed in Chapter 1. When you move into microservices architecture, you will still need to integrate your microservices to build any meaningful business use cases. There are several important requirements in a microservices architecture that makes the microservice integration quite critical. •
168
Microservice composition: Creating a composite service out of the existing microservices and exposing that as a business functionality to the consumers is one of the most common use cases in microservices architecture. The composition can be built using synchronous communication (active) or using asynchronous (reactive) communication patterns.
Chapter 7
Integrating Microservices
•
Building resilient inter-service communication: All microservice calls take place on the network and are prone to failures. Therefore, we need to implement the stabi
Data Loading...