apache-camel - 在 OnException 块中访问骆驼交换对象
问题描述
.onException(SocketTimeoutException.class,ConnectException.class)
.handled(true)
.maximumRedeliveries(5)
.maximumRedeliveryDelay(5*1000)
我想使用交换对象属性值来配置 maximumRedeliveries 和 maximumRedeliveryDelay。
解决方案
您可以使用retryWhile
来onException
确定是否继续重试。您可以Exchange.REDELIVERY_DELAY
在消息头中用作键来动态设置延迟。
推荐阅读
- excel - 从 Matlab 导出日期到 excel
- node.js - Nestjs 和 TypeOrm:使用 getOne() / getMany() 的查询生成器没有结果
- bash - 使用 bash 调用 Go 和 Python 脚本
- tensorflow - tensorflow 以行向量还是列向量为中心?
- python - 使用 Pytube 下载 youtube 视频
- javascript - Vue.js – 如何使用 Vuetify 构建像 Doodle 这样的表格?
- php - 如何在 php 中按不同语言(西班牙语、法语、俄语等)的字母顺序对数组进行排序?
- firebird - Firebird 为 sysdba 用户更改默认密码后不会忘记默认密码
- php - 从 PHP 数组中提取值并回显来自 Curl 脚本的 HTML 页面多维响应
- python - Python:请求 ID 线程本地日志记录