聊聊rocketmq的RemotingException
序
本文主要研究一下rocketmq的RemotingException
RemotingException
org/apache/rocketmq/remoting/exception/RemotingException.java
public class RemotingException extends Exception {private static final long serialVersionUID = -5690687334570505110L;public RemotingException(String message) {super(message);}public RemotingException(String message, Throwable cause) {super(message, cause);}
}
- 继承自checked exception,底下有RemotingCommandException、RemotingConnectException、RemotingSendRequestException、RemotingTimeoutException、RemotingTooMuchRequestException
RemotingCommandException
org/apache/rocketmq/remoting/exception/RemotingCommandException.java
public class RemotingCommandException extends RemotingException {private static final long serialVersionUID = -6061365915274953096L;public RemotingCommandException(String message) {super(message, null);}public RemotingCommandException(String message, Throwable cause) {super(message, cause);}
}
- RemotingCommand解码decodeCommandCustomHeader时可能抛出的异常
RemotingConnectException
org/apache/rocketmq/remoting/exception/RemotingConnectException.java
public class RemotingConnectException extends RemotingException {private static final long serialVersionUID = -5565366231695911316L;public RemotingConnectException(String addr) {this(addr, null);}public RemotingConnectException(String addr, Throwable cause) {super("connect to <" + addr + "> failed", cause);}
}
- NettyRemotingClient在channel出现问题的时候会抛出RemotingConnectException
RemotingSendRequestException
org/apache/rocketmq/remoting/exception/RemotingSendRequestException.java
public class RemotingSendRequestException extends RemotingException {private static final long serialVersionUID = 5391285827332471674L;public RemotingSendRequestException(String addr) {this(addr, null);}public RemotingSendRequestException(String addr, Throwable cause) {super("send request to <" + addr + "> failed", cause);}
}
- NettyRemotingClient在发送请求失败的时候,会抛出RemotingSendRequestException
RemotingTimeoutException
org/apache/rocketmq/remoting/exception/RemotingTimeoutException.java
public class RemotingTimeoutException extends RemotingException {private static final long serialVersionUID = 4106899185095245979L;public RemotingTimeoutException(String message) {super(message);}public RemotingTimeoutException(String addr, long timeoutMillis) {this(addr, timeoutMillis, null);}public RemotingTimeoutException(String addr, long timeoutMillis, Throwable cause) {super("wait response on the channel <" + addr + "> timeout, " + timeoutMillis + "(ms)", cause);}
}
- NettyRemotingClient在发送请求时,如果返回回来的RemotingCommand为null,但是发送请求成功,则抛出RemotingTimeoutException
RemotingTooMuchRequestException
org/apache/rocketmq/remoting/exception/RemotingTooMuchRequestException.java
public class RemotingTooMuchRequestException extends RemotingException {private static final long serialVersionUID = 4326919581254519654L;public RemotingTooMuchRequestException(String message) {super(message);}
}
- NettyRemotingAbstract在执行请求之前要进行流控,如果获取不到信号量,则区分是否是超时,如果是无timeout获取信号量也没获取到,则表示RemotingTooMuchRequestException
小结
rocketmq的remoting模块的异常采用的是checked exception,定义了根异常RemotingException,底下有几个异常分别为RemotingCommandException、RemotingConnectException、RemotingSendRequestException、RemotingTimeoutException、RemotingTooMuchRequestException。
doc
- RemotingException
聊聊rocketmq的RemotingException相关推荐
- 真香,聊聊 RocketMQ 5.0 的 POP 消费模式!
大家好,我是君哥. 大家都知道,RocketMQ 消费模式有 PULL 模式和 PUSH 模式,不过本质上都是 PULL 模式,而在实际使用时,一般使用 PUSH 模式. 不过,RocketMQ 的 ...
- 聊聊rocketmq的ProducerImpl
序 本文主要研究一下rocketmq的ProducerImpl ProducerImpl io/openmessaging/rocketmq/producer/ProducerImpl.java pu ...
- 聊聊rocketmq的BrokerHousekeepingService
为什么80%的码农都做不了架构师?>>> 序 本文主要研究一下rocketmq的BrokerHousekeepingService BrokerHousekeepingServ ...
- 与顶级互联网公司技术大佬面对面聊聊RocketMQ
作为由阿里巴巴捐赠的Apache顶级云原生消息中间件,RocketMQ 立足于在线交易链路,帮助企业实现异步解耦和削峰填谷以及 IoT 边缘数据以及 C 端用户行为数据采集传输和集成等众多功能.我们可 ...
- 聊聊rocketmq的ConsumerManageProcessor
序 本文主要研究一下rocketmq的ConsumerManageProcessor NettyRequestProcessor rocketmq-all-4.6.0-source-release/r ...
- 聊聊rocketmq的ConsumerIdsChangeListener
序 本文主要研究一下rocketmq的ConsumerIdsChangeListener ConsumerGroupEvent rocketmq-all-4.6.0-source-release/br ...
- 聊聊rocketmq的FileAppender
序 本文主要研究一下rocketmq的FileAppender WriterAppender org/apache/rocketmq/logging/inner/LoggingBuilder.java ...
- 深入源码聊聊RocketMQ刷盘机制
大家好,我是Leo. 今天聊一下RocketMQ的三种刷盘机制. 同步刷盘 异步刷盘(RocketMQ默认) 异步刷盘+缓冲区 出自微信公众号[欢少的成长之路] 本章概括 同步刷盘 整个同步刷盘策略由 ...
- 面试官:哥们,你们的系统架构中为什么要引入消息中间件?
点击上方"蓝字", 右上角选择"设为星标" 周一至五早11点半!精品文章准时送上! 本文来自石杉的架构笔记 这篇文章开始,我们把消息中间件这块高频的面试题给大家 ...
最新文章
- 【linux】Valgrind工具集详解(十二):DHAT:动态堆分析器
- TScreen 类 - 获取字体列表
- 列表框QListWidget 类
- 深度学习预训练模型可解释性概览
- lua 字符串分割_Lua 分隔字符串,可以设置指定分隔符
- unity中解析excel表
- gpu处理信号_GPU显卡不仅用来打游戏那么简单,它还可以用于通用加速计算
- 划入 .NET 6版本目标,微软鼓励开发人员信任第三方库
- P5470-[NOI2019]序列【模拟费用流】
- 微型计算机主机的主要组成部件是,微型计算机主机的主要组成部分有
- vue中pdf预览组件_Vue+ElementUI使用vue-pdf实现预览功能
- 机器学习如何解决问题
- 腾讯无人车开进硅谷!建团队、招人才,国内放出商务岗位
- 体验:Office SharePoint foundation 2010 Beta版安装使用
- java包含某个字符串_JavaScript判断一个字符串是否包含指定子字符串的方法
- JS 生成英文字母 A-Z
- Hibernate配置文件,映射文件
- Bootstrap模态框如何垂直居中?
- 计算机启动windows程序,win7系统开机自动运行程序怎么设置|win7电脑开机启动程序的方法...
- pycharm 拼音检查