tfdream / mango Goto Github PK
View Code? Open in Web Editor NEWA high-performance, open-source java RPC framework.
License: Apache License 2.0
A high-performance, open-source java RPC framework.
License: Apache License 2.0
你好,请问一下,buildReferenceChain方法中有一个一段代码,这个f变量有什么作用,在for中并没有使用到。
for (Filter filter : filters) {
final Filter f = filter;
final Reference lr = lastReference;
// ...
}
增加Netty心跳检测机制
RPC(Remote Procedure Call )——远程过程调用,它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议。
通俗一点说就是:调用远程计算机上的服务,就像调用本地服务一样,让调用者对网络通信这些细节透明。
过程描述如下:
RPC的目标就是要2~8这些步骤都封装起来,让用户对这些细节透明。
在RPC框架中主要有三个角色:Provider、Consumer和Registry。如下图所示:
主要技术要点如下:
RPC框架需要封装通信细节让用户像以本地调用方式调用远程服务,如何才能做到透明化调用呢?对Java来说就是使用动态代理技术。
Java动态代理实现:
许多优秀的Java框架都使用了动态代理技术,例如Spring AOP、MyBatis、众多RPC框架等。
客户端代理里需要封装通信细节,客户端和服务端进行通信的第一步就是要确定客户端和服务端相互通信的消息结构。包含客户端请求消息和服务端响应消息。
客户端的请求消息(Request)结构一般需要包括以下内容:
1、接口名称
完全类名,例如 “mango.demo.service.DemoService”;
2、方法名
3、参数类型&参数值
以及相应的参数值;
4、超时时间
5、requestId,标识唯一请求id。
服务端返回的消息结构一般包括以下内容:
1、执行结果(返回值or异常)
2、requestId
序列化就是将数据结构或对象转换成二进制流的过程,也就是编码的过程。
将在序列化过程中所生成的二进制流转换成数据结构或者对象的过程。
目前国内各大互联网公司广泛使用hessian、protobuf、thrift、avro等成熟的序列化解决方案来搭建RPC框架。(性能测试参见:jvm-serializers benchmark)
目前有两种IO通信模型:
服务注册中心功能包括注册服务、订阅服务、服务变更通知等功能;
Server端会在系统初始化时通过registry模块注册服务;
Client端在系统初始化时会通过registry模块订阅到具体提供服务的Server列表,当Server列表发生变更时也由registry模块通知Client。
注册中心选型:
通常情况下我们选用Zookeeper作为注册中心。
--------END-------
检测到 TFdream/mango 一共引入了34个开源组件,存在18个漏洞
漏洞标题:Apache Log4j不可信数据反序列化漏洞
缺陷组件:log4j:[email protected]
漏洞编号:CVE-2019-17571
漏洞描述:Apache Log4j是美国阿帕奇(Apache)软件基金会的一款基于Java的开源日志记录工具。
Apache Log4j 1.2版本中存在安全漏洞。攻击者可利用该漏洞执行代码。
国家漏洞库信息:https://www.cnvd.org.cn/flaw/show/CNVD-2020-00502
影响范围:[0, ∞)
最小修复版本:
缺陷组件引入路径:com.mindflow:[email protected]>com.101tec:[email protected]>org.apache.zookeeper:[email protected]>log4j:[email protected]
另外还有18个漏洞,详细报告:https://mofeisec.com/jr?p=ib0d33
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.