002 Service Center

Source: Internet
Author: User

I. Overview

Our microservices can be broadly divided into the following two categories:

[1] Producers of services

[2] Consumers of the service

Service between the producer and the consumer through the service center to determine the other party's existence, and the other's basic information.

The following describes the relationship between the three:

[1] When the producer starts, it registers its own information (description of the hostname+port+ micro-service) on the service center.

[2] The consumer discovers the producer's information through the service center and then invokes the producer's microservices as appropriate.

Let's take a look at the following view:

  

We can see the basic relationship between the three, and all microservices need to register themselves on the Service Discovery Component (Service center).

The microservices call is then completed by registering the information on the service center.

Here are a few concepts to be covered:

[1] Each micro-service needs to have a applicationname, the name of the application describes what services they provide

[2] Each registration information must contain its own hostname and port information, or the micro-service can not be invoked.

[3] Each registered microservices need to have a instanceid (also can be said to be the name of the instance), usually each instance of the name is not the same, we can use the name of the instance to quickly know what the micro-service is doing.

Two. Role of service centres

The role of the service center is mainly concentrated in the following two areas:

[1] Registration of services: every micro-service needs to register its own information to the service center, so that other micro-services can know the existence of the micro-service.

[2] Service discovery: Refers to the ability to find a microservices instance through a service center (mainly hostname and port).

In Springcloud, our most used service center is Eureka. Below we will build a service center of our own.

002 Service Center

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.