- 授权协议: Apache
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://gitee.com/dzh/dimit
- 软件文档: https://gitee.com/dzh/dimit
软件介绍
dimit
分布式流控系统 QQ: 527645454 (开发讨论群)
快速开始
-
maven加pom依赖
io.github.dzh dimit-core io.github.dzh dimit-zk
-
初始化StoreSystem
String uri = "dimit-zk://dzh/dimit?host=127.0.0.1:2181&sleep=1000&retry=3"; DimitStoreSystem dss = DimitStores.newStoreSystem(URI.create(uri), null);
-
依次创建流控Conf,配置结构层次:
- DimitConf 定义一个流控器 - ChannelGroupConf 通道组配置 - ChannelConf 通道配置
注: 参考单位测试 dimit-demo/../TestZkStoreConfDemo
-
初始化Dimiter,依据流控Conf创建对应的运行时数据
// init dimiter and runtime channels String uri = "dimit-zk://dzh/dimit?host=127.0.0.1:2181&sleep=1000&retry=3"; Dimiter dimiter = Dimiter.newDimiter(URI.create(uri), null, dimitConfId); ChannelGroupWrapper group = demo.initChannelGroup(channelGroupConfId); group.newChannel(ChannelConfId_1, ChannelType.SEND); group.newChannel(ChannelConfId_2, ChannelType.SEND); // select Listselected = group.select(TagA,TagB); V result = null; for(ChannelWrapper channel : selected) { try{ result = channel.call(new ChannelCallable { // TODO request ... }); // TODO parse result ... break; }catch(RateLimiterException e){ LOG.info(e.getMessage(), e); }catch(InvalidChannelException e){ LOG.error(e.getMessage(), e); }catch(Exception e){ // or break LOG.error(e.getMessage(), e); } } // program exit dimiter.close();
注: 参考单位测试 dimit-demo/../TestDimiterDemo
特性列表
-
流量控制
-
ChannelConf定义max-tps, Channel实例的tps = max-tps / Channel总数
-
-
Tag筛选
-
ChannelConf定义通道的tag列表,ChannelGroupWrapper.select(...)时选择满足条件的Channel组
-
-
主备切换
-
ChannelConf定义通道ChannelStatus, select返回的可用通道列表里PRIMARY优先于STANDBY
-
-
质量分析
-
启用Channel的质量分析功能(
stat.enable=true默认开启),在ChannelWrapper.call()时采集stat信息
-
-
异常切换
-
通过stat信息动态计算ChannelWrapper.priority(), 影响select结果
-
-
Web管理
-
TODO
-
环境依赖
-
JDK1.7 or higher
-
maven 3
-
protobuf 3
-
servlet-api v3.1.0 TODO 使用wep4j
精通Windows应用开发
[美] Jesse Liberty Philip Japikse Jon Galloway / 苏宝龙 / 人民邮电出版社 / 59.00元
Windows 8.1的出现不仅提供了跨设备的用户体验,也提供了跨设备的开发体验。本书着眼于实际项目中所需要的特性,以及现有C#编程知识的运用,对如何最大限度地利用Metro、WinRT和Windows 8进行了讲解,内容详尽,注重理论学习与实践开发的配合。 Windows 8.1和WinRT的作用及其特殊性 如何使用先进特性创建具有沉浸感和吸引力的Windows 8.1应用 如......一起来看看 《精通Windows应用开发》 这本书的介绍吧!
图片转BASE64编码
在线图片转Base64编码工具
XML、JSON 在线转换
在线XML、JSON转换工具
