摘要
随着互联网的高速发展,淘宝、微信、12306和各类直播平台等各种规模庞大、高频率、高峰值的应用层出不穷,而且在一些特殊节点,比如淘宝的双十一购物节、12306的春运抢票高峰等,系统的访问量更是日常流量的几万甚至千万倍。为了支撑起如此庞大的性能需求,迫切需要各种层面的配合。
传统的单体式架构,虽然易于开发、部署和扩展,但是存在很多的弊端,特别是应用变大或者团队扩大,这些弊端将更为明显和严重,对企业的长远发展是十分不利的。
由此,技术人员在2012年提出了微服务的概念,指明组件化和服务化是系统架构发展的必然趋势,虽然在一定程度上增加了前期开发的复杂度,提高了部署的技术难度,但是可以为企业的长远发展建立坚实的基础,其利益远大于弊端。因此,研究微服务系统架构的优势和核心要点,探索rabbitMQ技术在大型业务系统中的应用,对于开发低延迟、高并发、高性能、高可用、高可靠的应用系统很有辅助作用。
基于上述背景,本毕业设计在深入理解微服务架构的技术背景、实现原理与优缺点的前提下,对微服务架构中各个组件之间基于消息队列的异步通信模式进行了技术研究,以典型的消息队列rabbitMQ为主要技术手段,以时下流行的轻量级框架spring boot为容器,借助java开发语言,实现了微服务架构常用的消息中间件。
论文首先对所用技术进行了理论研究与概述,然后利用以上技术实现了三种应用场景下的应用组件,分别是邮件服务器、复杂业务拆分和分布式任务处理;该组件可与业务应用集群通过消息队列进行通信,作为一个独立的模块帮助业务系统完成一些功能,减轻服务器压力。
【关键词】rabbitMQ springboot 微服务 消息中间件
abstract
With the rapid development of the Internet, various large-scale, high-frequency, and high-peak applications such as Taobao, WeChat, 12306, and various types of live broadcast platforms emerge in an endless stream, and at certain special nodes, such as Taobao’s Double 11th Shopping Festival and 12306 Spring Festival. To grab the peak of votes, the system's traffic is tens of thousands or even ten million times the daily traffic. In order to support such a large amount of performance requirements, there is an urgent need for various levels of cooperation.
Although the traditional single-unit architecture is easy to develop, deploy, and expand, it has many drawbacks, especially if the application becomes large or the team expands. These drawbacks will become more apparent and serious, which is very unfavorable to the long-term development of the company.
As a result, the technicians proposed the concept of microservices in 2012, indicating that componentization and service are inevitable trends in the development of system architecture. Although the complexity of pre-development has been increased to some extent, and the technical difficulty of deployment has been improved, It can establish a solid foundation for the long-term development of the company, and its benefits far outweigh the disadvantages. Therefore, to study the advantages and core points of microservice system architecture, and to explore the application of rabbitMQ technology in large-scale business systems, it is helpful to develop low latency, high concurrency, high performance, high availability, and high reliability of application systems.
Based on the above background, under the premise of in-depth understanding of the technical background, implementation principle, and advantages and disadvantages of the microservice architecture, this graduation design conducted a technical research on the asynchronous communication model based on the message queue among the various components in the microservice architecture. The message queue rabbitMQ is the main technical means. With the popular lightweight framework spring boot as a container, with the help of the Java development language, the message middleware commonly used in the microservice architecture is realized.
The paper firstly studies and summarizes the technologies used, then uses the above technologies to implement the application components in three application scenarios, namely, mail server, complex service splitting, and distributed task processing; this component can be used with business application clusters. The message queue communicates as an independent module to help the business system perform some functions and relieve server pressure.
【key words】 rabbitMQ springboot message queue light server
目录
1 引言
1.1 选题背景及论文意义
1.2 系统现状与发展分析
1.3 论文主要内容及组织结构
2 关键技术介绍
2.1 系统基础技术介绍
2.1.1 mysql简介
2.1.2 spring mvc简介
2.1.3 mybatis介绍
2.2 SpringBoot框架介绍
2.2.1 SpringBoot简介
2.2.2 框架应用场景与优势
2.3 rabbitMQ介绍
2.3.1 概念、原理与特点
2.3.2 应用场景与实例
2.4 微服务架构介绍
2.4.1 微服务架构概念
2.4.2 微服务架构的优势
3 系统需求分析
3.1 系统简介
3.2 应用场景描述
3.2.1 邮件服务器
3.2.2 复杂业务拆分
3.2.3 分布式任务处理
3.3 系统需求分析
3.3.1 系统整体需求描述
3.3.2 邮件服务器需求描述
3.3.3 复杂应用拆分需求描述
3.3.4 分布式任务处理需求描述
4 系统功能设计
4.1 总体功能概述
4.2 详细功能设计
4.2.1 整体功能
4.2.2 邮件服务器
4.2.3 复杂业务拆分
4.2.4 分布式任务处理
4.3 数据库设计
4.3.1 邮件服务器
4.3.2 复杂业务拆分
4.3.3 分布式任务处理
5 系统功能实现
5.1 系统管理员登录
5.2 邮件服务器
5.2.1 邮件模板管理
5.2.2 邮件消息监听和持久化
5.2.3 邮件发送
5.2.4 邮件日志查询
5.3 复杂业务拆分
5.4 分布式任务处理
6 总结与展望
6.1 应用优势
6.2 优化方向与方案
参考文献
致 谢