Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Build a micro-service framework and test environment-2-registry

Shulou Source: shulou.com Published: 2022-06-03 05:14:34 10月25日 Update

It should have been based on the logic of what-how-why. However, in order to show you the actual and obvious effect, the registration center is specially put forward.

1. Eureka server example

(1) create a project using Fileholders Newspeak Spring Starter Project, and follow the wizard to select Eureka Server:

(2) check dependencies:

Eureka Server dependencies:

Spring Cloud management dependencies:

Warehouse:

(2) Construction of registry

Just add the annotation @ EnableEurekaServer

II. Eureka client example

(1) create a project using Fileholders Newspeak Spring Starter Project, and follow the wizard to select Eureka Discovery:

(2) check dependencies:

Eureka Discovery dependencies:

Also web depends on:

Spring Cloud management dependencies:

Warehouse:

(2) client service construction

Just add the annotation @ EnableDiscoveryClient.

It also provides RESTful-based WebService, using the annotation @ RestController.

In order for the registry to recognize the service name, you need to specify an ApplicationName in the bootstrap.properties file:

After starting the registry and client services, use the Chrome test:

The effect has been seen, and then let's start with a full set of SPA services from scratch.

Tags: Services annotations warehouses wizards customers clients effects examples projects inspection management selection testing obvious middle finger ab initio full set at the same time name actual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Microsoft Shulou Tech Info Docker Linux