当前位置:网站首页>Case introduction and problem analysis of microservice
Case introduction and problem analysis of microservice
2022-07-02 15:20:00 【enterpc】
One . Case description
In this part, we follow the general ⽅ Type simulation ⼀ The adjustment between micro Services ⽤( We will ⼀ Step by step ⽤
Spring Cloud The component of the case example ⾏ reform ).
pinkie promise App⾥ There is such ⼀ Features :“⾯ Try straight through ⻋”, When applying for a job ⽤ The door is opened ⾯ Try straight through ⻋ after , Meeting
Enter according to the job requirements of enterprise customers ⾏ Two way matching . Among them is ⼀ The first operation is : For business ⽤ Open the door
⼀ Scheduled tasks , According to the enterprise record ⼊ Of ⽤⼈ Conditions , Every time ⽇ matching ⼀ A certain number of applicants “ The delivery ” To the enterprise
In the resource pool , Then the system needs to check before delivering the matched candidates to the resource pool : this
The default resume status of the applicant ( Open / hide ), If the status of the default resume has been set by the applicant
by “ hide ”, Then no longer cling ⾏“ The delivery ” operation .“⾃ Automatic delivery function ” stay “⾃ Mobile delivery microservice ” in ,“ resume
Status query function ” stay “ Resume microservice ” in , Then it's about “⾃ Mobile delivery microservice ” transfer ⽤“ Resume microservice ”
Query resume . In this case ,“⾃ Mobile delivery microservice ” Namely ⼀ Service consumers ,“ Resume microservice ” Just
yes ⼀ Service providers .

Two . Case database environment preparation
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for r_resume
-- ----------------------------
DROP TABLE IF EXISTS `r_resume`;
CREATE TABLE `r_resume` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sex` varchar(10) DEFAULT NULL COMMENT ' Gender ',
`birthday` varchar(30) DEFAULT NULL COMMENT ' Date of birth ',
`work_year` varchar(100) DEFAULT NULL COMMENT ' Years of service ',
`phone` varchar(20) DEFAULT NULL COMMENT ' Phone number ',
`email` varchar(100) DEFAULT NULL COMMENT ' mailbox ',
`status` varchar(80) DEFAULT NULL COMMENT ' Current state of ',
`resumeName` varchar(500) DEFAULT NULL COMMENT ' Resume name ',
`name` varchar(40) DEFAULT NULL,
`createTime` datetime DEFAULT NULL COMMENT ' Date of creation ',
`headPic` varchar(100) DEFAULT NULL COMMENT ' Head portrait ',
`isDel` int(2) DEFAULT NULL COMMENT ' Whether or not to delete The default value is 0- Not delete 1- deleted ',
`updateTime` datetime DEFAULT NULL COMMENT ' Resume update time ',
`userId` int(11) DEFAULT NULL COMMENT ' user ID',
`isDefault` int(2) DEFAULT NULL COMMENT ' Is it the default resume 0- Default 1- Non default ',
`highestEducation` varchar(20) DEFAULT '' COMMENT ' The highest record of formal schooling ',
`deliverNearByConfirm` int(2) DEFAULT '0' COMMENT ' Send the attached resume to confirm 0- Need to confirm 1- There is no need to confirm ',
`refuseCount` int(11) NOT NULL DEFAULT '0' COMMENT ' The number of times your resume was rejected ',
`markCanInterviewCount` int(11) NOT NULL DEFAULT '0' COMMENT ' Marked as number of interviews available ',
`haveNoticeInterCount` int(11) NOT NULL DEFAULT '0' COMMENT ' The number of interviews has been informed ',
`oneWord` varchar(100) DEFAULT '' COMMENT ' Introduce yourself in a word ',
`liveCity` varchar(100) DEFAULT '' COMMENT ' Live in city ',
`resumeScore` int(3) DEFAULT NULL COMMENT ' Resume score ',
`userIdentity` int(1) DEFAULT '0' COMMENT ' User's identity 1- Student 2- Worker ',
`isOpenResume` int(1) DEFAULT '3' COMMENT ' Talent search - Open your resume 0- close ,1- open ,2- Resume does not meet the standard of passive closing 3- Never set up an open resume ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2195388 DEFAULT CHARSET=utf8;
3、 ... and . Case study ⼯ Process environment preparation
We are based on SpringBoot To construct the ⼯ Process environment , our ⼯ The process module relationship is as follows :
Four . Sample code
5、 ... and . Case code problem analysis
We are ⾃ Mobile delivery microservice enables ⽤RestTemplate transfer ⽤ Resume status of resume micro service is connected ⼝ when
(Restful API Pick up ⼝). In microservice Distributed cluster environment What will be the problem ? How to solve ?
The problem is :
1) Among service consumers , We put url Hard code the address into the code , No ⽅ For later maintenance .
2) The only service providers are ⼀ A service , Even if service providers form clusters , Service consumers also need ⾃⼰ real
Now load balancing .
3) Among service consumers , Don't know the status of the service provider .
4) Service consumers adjust ⽤ When the service provider , If there is a fault, can we find it in time ⽤ The user throws an exception
⻚⾯?
5)RestTemplate This request calls ⽤⽅ Whether there is room for optimization ? Can it be similar to Dubbo like that
play ?
6) So many microservices ⼀ How to implement authentication ?
7) To configure ⽂ It's troublesome to modify many pieces every time !?
8)....
The problems from the above analysis , In fact, it is inevitable in the microservice architecture ⾯ Yes ⼀ Some questions :
1) Service management :⾃ Mobile registration and discovery 、 Status supervision
2) Service load balancing
3) Fuse
4) Remote process control ⽤
5)⽹ Off interception 、 Routing and forwarding
6) system ⼀ authentication
7) Centralized configuration management , Real time configuration information ⾃ Dynamic update
These problems ,Spring Cloud The system has been solved ⽅ case , In the future, we will learn one by one .
边栏推荐
- php获取数组中键值最大数组项的索引值的方法
- c语言入门--数组
- Base64 coding can be understood this way
- Key points of compilation principle examination in 2021-2022 academic year [overseas Chinese University]
- . Net core logging system
- TiDB数据迁移场景综述
- 06_ Stack and queue conversion
- Application and practice of Jenkins pipeline
- HUSTPC2022
- 飞凌嵌入式RZ/G2L处理器核心板及开发板上手评测
猜你喜欢
随机推荐
FPGA - 7系列 FPGA内部结构之Clocking -03- 时钟管理模块(CMT)
HUSTPC2022
11_ Redis_ Hyperloglog_ command
Dragonfly low code security tool platform development path
Map介绍
08_ 串
21_ Redis_ Analysis of redis cache penetration and avalanche
数据分析思维分析方法和业务知识——业务指标
Table responsive layout tips
AtCoder Beginner Contest 254
基于RZ/G2L | OK-G2LD-C开发板存储读写速度与网络实测
The past and present lives of visual page building tools
搭载TI AM62x处理器,飞凌FET6254-C核心板首发上市!
TiDB 集群最小部署的拓扑架构
How does the computer set up speakers to play microphone sound
TiDB数据迁移场景综述
数据分析常见的英文缩写(一)
Application of CDN in game field
07_ Hash
C# richTextBox控制显示最大行数