An introduction to Microservices
Microservices are an architecture style used by many organizations to go beyond Service Oriented Architecture. Microservices are designed to achieve a high degree of agility, fast delivery, and to scale.
Overview
Pre-requisites:
You will need Talend ESB 6.2 or later to be able to follow this guide. Talend introduced the ability to build microservices since version 6.2. Also, due to the nature of microservices, you can only build microservices with Mediation routes components in Talend 6.2 as you will see later in this guide.
Microservice
Microservices are an architectural style or an approach to building IT systems. These are considered as a set of business capabilities that are autonomous, self-contained, and loosely coupled.
As for communication or transport among microservices, there is no agreed standard. In general, microservices communicate with each other using widely adopted lightweight protocols, such as HTTP and REST, or messaging protocols, such as JMS or AMQP.
As microservices are more aligned to business capabilities and have independently manageable life cycles, they are the ideal choice for enterprises embarking on DevOps and cloud. DevOps and cloud are two facets of microservices.
Scenario
In this example, we will build three Microservices using Talend Studio and will monitor them using Talend Runtime and Talend Administration Center. We will expose a rest interface that will deliver customer data.
An Audit Service listening on a queue will display message on the console. The third service will call the rest interface to retrieve the customer data. Normally, microservices should only be limited to be "Provider" services.
Designing Microservices with Talend Studio
It is very easy to build microservices using Talend Studio. Talend leverages the Spring Boot features to export any service as an independent and self-managed service. Before we start programming microservices, we need to set the maven preferences in Talend studio.
Please make sure that your system has Java 1.8 installed and JAVA_HOME variable is set correctly.
Audit Service
The Audit Service will listen to a JMS queue and will simply log the message on the console.
Procedure
Customer Service Provider
Procedure
Customer Service Consumer
In this example, you will consume a rest service to demonstrate how to call a rest service.