Nepxion-Thunder(QQ 群 471164539)发布在https://github.com/Nepxion/
基于Google Guava EventBus,实现事件驱动发布框架内部事件,解除耦合;发布外部事件,进行重试补偿,异常通知(邮件或短信通知)
1)eventbus - 基于Google Guava的进程内发布/订阅机制,支持同步和异步事件发布
2)mobile - 基于EventBus的异常信息的短信通知,未实现
3)protocol - 基于EventBus的异常信息的发布/拦截,是其它事件通知模块的基础
4)registry - 基于EventBus的上下线通知,通过Zookeeper的Watcher事件来发布
5)smtp - 基于EventBus的Smtp协议的邮件通知,支持普通邮件和SSL认证邮件
1. 系统通知
邮件通知,一旦框架中有异常抛出,立即通过给定的邮件予以通知,
短信通知,未实现
2. 业务层面的异常事件拦截
ProtocolEventInterceptor可以拦截和通知如下的异常:
- 业务系统中抛出的任何异常
- 业务系统定义的超时异常(异步和同步,但不支持广播)
- 框架的中间价宕机产生异常,目前只支持Netty
- 框架服务治理产生异常,例如限流异常
业务系统只需要继承ProtocolEventInterceptor,实现onEvent方法,就可以捕获全部异常抛出
public class ServiceEventInterceptor extends ProtocolEventInterceptor { @Override protected void onEvent(ProtocolEvent event) { ApplicationType applicationType = event.getApplicationType(); ActionType actionType = event.getActionType(); ProtocolType protocolType = event.getProtocolType(); ProtocolMessage protocolMessage = event.getProtocolMessage(); System.out.println("--------------------收到异步事件通知--------------------"); System.out.println("Application type=" + applicationType); System.out.println("Action type=" + actionType); System.out.println("Protocol type=" + protocolType); if (actionType != ActionType.SYSTEM) { System.out.println("Trace id=" + protocolMessage.getTraceId()); System.out.println("Interface=" + protocolMessage.getInterface()); System.out.println("Method=" + protocolMessage.getMethod()); System.out.println("Parameter types=" + Arrays.asList(protocolMessage.getParameterTypes())); System.out.println("Parameters=" + Arrays.asList(protocolMessage.getParameters())); } else { System.out.println("From url=" + protocolMessage.getFromUrl()); System.out.println("To url=" + protocolMessage.getToUrl()); } System.out.println("Exception=" + ExceptionUtil.toExceptionString(protocolMessage.getException())); System.out.println("-------------------------------------------------------"); } }
框架接入比较简单,见下面的示例
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:thunder="http://www.nepxion.com/schema/thunder" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.nepxion.com/schema/thunder http://www.nepxion.com/schema/thunder/thunder-1.0.xsd"> ....... <!-- 异常的EventBus事件发布拦截 --> <bean id="eventInterceptor" class="com.nepxion.thunder.service.ServiceEventInterceptor"/> </beans>
相关推荐
Coroutine是基于Kilim/Promise JDeferred的协程式驱动框架,基于Apache Zookeeper的分布式规则存储和动态规则变更通知。 主要特性: 1. 基于微服务框架理念设计 2. 支持同步/异步调用 3. 支持串行/并行调用 4....
Nepxion Thunder是一款基于Netty + Hessian + Kafka + ActiveMQ + Tibco + Zookeeper(Curator Framework) + Redis + FST + Spring + Spring Web MVC + Spring Boot + Docker分布式RPC调用框架。架构思想主要是来自...
yinheli/docker-thunder-xware:latest 镜像打包下载 群晖 NAS DSM 系统,只要三步使用 Docker 安装迅雷远程下载
Thunder ⚡️ 一个Go框架用于快速构建强大的graphql服务
wine-thunder_0.6-2_all.deb用于在linux系统下,使用wine直接按装的迅雷软件,实现高速下载,在ubunut,fedora等linux版本中,实现直接点击安装
开源项目-omeid-thunder.zip,Thunder Bolt = High Productivity
A10-Thunder_930方案白皮书.pdf
A10-Thunder_1030S方案白皮书.pdf
开源项目-muesli-thunder.zip,thunder, an interactive shell for BoltDB
A10-Thunder_5430S方案白皮书
A10-Thunder_6430S方案白皮书.pdf
系统工具-文件下载-Thunderbird91.0b4.zip
系统工具-文件下载-thunder_3.4.0.4338.zip
A10-Thunder_5430S方案白皮书.pdf
3D-Thunder-Lightning.zip,受航母指令启发的开源未来动作飞行模拟器游戏,3D建模使用专门的软件来创建物理对象的数字模型。它是3D计算机图形的一个方面,用于视频游戏,3D打印和VR,以及其他应用程序。
Thunder Android OkHttp util package let response callback at MainThread(UIThread), also it‘s lifecycle safety. ⚠️ Thunder‘s code is based on SugarTask(Very nice code
please update the test cases that cannot compile any more
【批量下载】Thunder-Download-Extension-for-Chrome_v3.1
实时过境雷湾 ... 运行npm install live-transit-thunder-bay --save 使用 API: var liveTransit = require ( 'live-transit-thunder-bay' ) ; liveTransit . start ( ) ; 运行node index.js 。 Expres
docker pull yinheli/docker-thunder-xware:latest 创建一个下载目录. 用于挂载卷 mkdir data 运行 docker run -d \ --name=xware \ --net=host \ -v $(pwd)/data:/app/TDDOWNLOAD \ yinheli/docker-thunder-...