Skip to content

Commit

Permalink
更新RM
Browse files Browse the repository at this point in the history
  • Loading branch information
xueli.xue committed Aug 28, 2016
1 parent c7e5d66 commit 0ce1ef6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 12 deletions.
25 changes: 17 additions & 8 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,27 @@ ZK节点:
- address2
```

- client(producer): rpc客户端, 向远程rpc发送请求服务
- client(consumer) rpc服务, 端口 6070, 自动注册
- broker: rpc服务, 端口 6080, 自动注册

实现原理:
- TOPIC处理器线程池: 一个 mq 一个线程, 节点最小的 broker,加载全部 TOPIC 消息, 匹配 mq 找到 consumer 地址列表, 广播发送消息(rpc请求, client接收到立即响应,执行结果异步通知);
- QUEUE处理器线程池: 一个 mq 一个线程, 节点最小的 broker,加载全部 TOPIC 消息, 匹配 mq 找到 consumer 地址列表, 选中最小的节点发送消息(rpc请求, client接收到立即响应,执行结果异步通知);
- CONCURRENT_QUEUE处理器:
- client(producer): rpc客户端
- client(consumer) 附带一个rpc服务, 端口 6070, 汇总@MqHandler
- broker: 附带一个rpc服务, 端口 6080, 接受,推送,回调



broker 实现原理:
- 代理把消息同步写入表
- 一个mq一个线程,各线程10s过滤一次消息表
- 广播:遍历所有节点,发送rpc请求
- 串行:匹配最小节点,发送rpc请求
- 并行:顺序选择节点,发送rpc请求

- 超时处理器: 每间隔30MIN扫描一次全表, 把超过1H状态仍然为ING的消息状态改为TIMEOUT,并在消息msg字段记录日志
- 报警器: 每间隔30MIN扫描一次全表, 以消息主题为维度进行统计, 邮件通知消息执行失败情况;

- 代理方轮训堵塞,只消费new状态消息,推送成功即改状态run
- 消费方串行,队列执行,容纳100,队列满则代理阻塞10s询问一次,直至降至5通知代理可以继续推送
- 并行,顺序遍历,各个节点容纳100,最后一个都都满了等10s,


##### 消息状态

##### 项目划分
Expand Down
11 changes: 7 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxl</groupId>
<artifactId>xxl-mq</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>${xxl.mq.version}</version>
<packaging>pom</packaging>
<modules>
<module>xxl-mq-core</module>
<module>xxl-mq-incubator</module>
<module>xxl-mq-demo</module>
</modules>
<module>xxl-mq-broker</module>
</modules>

<dependencies>
</dependencies>
<properties>
<xxl.mq.version>1.1.0</xxl.mq.version>
<spring.version>3.2.13.RELEASE</spring.version>
</properties>

<build>
<plugins>
Expand Down
15 changes: 15 additions & 0 deletions xxl-mq-broker/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>xxl-mq</artifactId>
<groupId>com.xxl</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>xxl-mq-broker</artifactId>


</project>

0 comments on commit 0ce1ef6

Please sign in to comment.