javaweb icon indicating copy to clipboard operation
javaweb copied to clipboard

http://www1350.github.io/

Results 100 javaweb issues
Sort by recently updated
recently updated
newest added

分析完了服务提供者,紧接着分析消费者。 从ReferenceBean入手 ## Config层 ### ReferenceBean ```java public void afterPropertiesSet() throws Exception { //init consumerConfig //... //init applicationConfig //init moduleConfig //init registryConfigs //init monitorConfig Boolean b = isInit(); if (b...

serialize层 dubbo的序列化方式包括:hessian2、fastjson、fst、jdk、kryo 只要通过配置`` 或`` 就可以实现 ```java @SPI("hessian2") public interface Serialization { /** * get content type id * * @return content type id */ byte getContentTypeId(); /** * get content...

本篇将着重分析dubbo的remoting模块 ## exchange 信息交换层 ### Exchangers(门面) ```java public class Exchangers { static { // check duplicate jar package Version.checkDuplicate(Exchangers.class); } private Exchangers() { } public static ExchangeServer bind(String url, Replier...

## 什么是Dubbo? Dubbo是阿里巴巴公司开源的一个高性能优秀的服务框架,使得应用可通过高性能的RPC实现服务的输出和输入功能,以及SOA服务治理方案,和spring框架无缝集成。 dubbo作为一个非常好的rpc项目,广泛在国内使用。 官网:http://dubbo.incubator.apache.org/ github地址:https://github.com/apache/incubator-dubbo 我们先看下项目结构: ![image](https://user-images.githubusercontent.com/7789698/38068732-4c032100-3345-11e8-9a0b-ff30047a09ec.png) 模块说明: - **dubbo-common 公共逻辑模块**:包括 Util 类和通用模型。 - **dubbo-remoting 远程通讯模块**:相当于 Dubbo 协议的实现,如果 RPC 用 RMI协议则不需要使用此包。 - **dubbo-rpc 远程调用模块**:抽象各种协议,以及动态代理,只包含一对一的调用,不关心集群的管理。 - **dubbo-cluster 集群模块**:将多个服务提供方伪装为一个提供方,包括:负载均衡, 容错,路由等,集群的地址列表可以是静态配置的,也可以是由注册中心下发。 -...

中间件

# 脚本分析 mqbroker.sh ``` #!/bin/sh if [ -z "$ROCKETMQ_HOME" ] ; then ## resolve links - $0 may be a link to maven's home PRG="$0" # need this for relative...

中间件

## rocketMQ通信模块 ![image](https://user-images.githubusercontent.com/7789698/32897440-358e21d4-caab-11e7-8f66-76a302229a2d.png) NettyRemotingClient ``` @Override public void start() { //业务线程池 this.defaultEventExecutorGroup = new DefaultEventExecutorGroup( nettyClientConfig.getClientWorkerThreads(), new ThreadFactory() { private AtomicInteger threadIndex = new AtomicInteger(0); @Override public Thread newThread(Runnable r)...

中间件

不同版本jdk实现都不太一样。 关于1.6 http://ifeve.com/java-concurrent-hashmap-1/ http://ifeve.com/java-concurrent-hashmap-2/ http://www.importnew.com/16147.html 为什么ConcurrentHashMap是弱一致的? (注意这是jdk1.6,1.7、1.8都不是弱一致了) http://ifeve.com/concurrenthashmap-weakly-consistent/ 关于1.7 http://www.blogjava.net/DLevin/archive/2013/10/18/405030.html 关于1.7和1.8区别 http://www.importnew.com/23610.html 接下来我们来分析1.8源码 先看下类的层次结构 ![image](https://user-images.githubusercontent.com/7789698/38029713-3789bf9e-32c9-11e8-8e4c-bf0ea2e685b8.png) ```java public class ConcurrentHashMap extends AbstractMap implements ConcurrentMap, Serializable { //最大容量不得超过1 e; return ((o instanceof...

java基础

我们看到最早的解析,是解析xml ``` ``` # StandardServer ![image](https://user-images.githubusercontent.com/7789698/37250854-7eee792e-2540-11e8-908d-9a3ed3205c72.png) ## StandardServer(LifecycleBase)的init ``` @Override public final synchronized void init() throws LifecycleException { if (!state.equals(LifecycleState.NEW)) { invalidTransition(Lifecycle.BEFORE_INIT_EVENT); } setStateInternal(LifecycleState.INITIALIZING, null, false); try { initInternal(); }...

tomcat

1.redis数据结构 # 简单字符串 redis专门封装了一个叫SDS的数据结构 ``` struct sdshdr { // 记录 buf 数组中已使用字节的数量 // 等于 SDS 所保存字符串的长度 int len; // 记录 buf 数组中未使用字节的数量 int free; // 字节数组,用于保存字符串 char buf[]; }; ```...

中间件

入门使用 :http://rocketmq.apache.org/docs/quick-start/ Download & Build from Release Click here to download the 4.2.0 source release. Also you could download a binary release from here. Now execute the following commands to...

中间件