建设网站需要哪些认证,做公众号的网站模板下载吗,用搬瓦工做储存网站,wordpress自定义html这是有关OpenHub框架的系列文章中的第三篇#xff0c;第一篇介绍OpenHub框架 #xff0c;第二篇介绍异步消息传递模型 。 该系列的最后一篇文章将更详细地介绍其他一些有趣的功能#xff0c;并说明为什么OpenHub可以成为您的集成项目的理想选择的原因。 节流 节流是一种功… 这是有关OpenHub框架的系列文章中的第三篇第一篇介绍OpenHub框架 第二篇介绍异步消息传递模型 。 该系列的最后一篇文章将更详细地介绍其他一些有趣的功能并说明为什么OpenHub可以成为您的集成项目的理想选择的原因。 节流 节流是一种功能用于检查对集成平台的输入请求的数量如果该数量超过定义的限制则新请求将受到限制。 节流的主要目标是通过大量的处理输入请求来限制集成平台的不成比例的通常是故意的过载。 这将对应用程序性能产生严重影响甚至可能停止处理当前消息。 节流组件对来自指定源外部系统以及特定操作的输入请求进行计数。 如果此计数在定义的时间间隔内超过了定义的限制则OpenHub将开始拒绝新的输入请求仅来自指定源系统和指定操作的请求–引发异常。 节流组件支持集群。 节流功能可以配置如下 ###############################################################################
# Throttling configuration
#
# There the following property names:
# - throttling.defaultInterval: default time interval (in seconds) if not defined by system/operation
# - throttling.defaultLimit: default limit if not defined by system/operation
# - throttling.sourceSystem.operationName, where
# - sourceSystem is specific source system or * if any system
# (source system is case-insensitive value from trace header (ExternalSystemExtEnum))
# - operationName is specific operation name or * if any operation
#
# Property values (except for default values) have the following format:
# limit [/interval]
#
# Examples:
# throttling.crm.op110
# throttling.crm.*10/40
# throttling.*.sendSms60/30
###############################################################################throttling.defaultInterval60
throttling.defaultLimit60
throttling.sourceSystem.*300/60
throttling.*.syncHello15/60
throttling.*.asyncHello50/60 例如 throttling.crm.op1 10 从CRM系统到操作op1的调用限制为60秒内有10个请求 throttling.crm。* 10/40 限制从CRM系统到40秒内10个请求的任何调用 * .sendSms 60/30 限制从任何系统到30秒内60个请求的sendSms操作调用 警报 警报定义用于监视数据库数据的度量标准如果任何度量标准超出其限制则会激活警报并可以执行进一步的操作。 度量是可配置的–用于获取项目计数和检查限制的SQL查询。 警报示例还包括后续操作 当最近10分钟的失败消息计数超过5时则向管理员发送电子邮件 当等待外部系统响应超过5分钟的邮件数超过10时则向管理员发送电子邮件 默认配置示例 ###############################################################################
# Alerts configuration
#
# There the following property names:
# - alerts.N.id: unique alert identification (if not defined then order number (N) is used instead)
# - alerts.N.limit: limit that must be exceeded to activate alert
# - alerts.N.sql: SQL query that returns count of items for comparison with limit value
# - [alerts.N.enabled]: if specified alert is enabled or disabled; enabled is by default
# - [alerts.N.mail.subject]: notification (email, sms) subject; can be used Java Formatter placeholders (%s alert ID)
# - [alerts.N.mail.body]: notification (email, sms) body; can be used Java Formatter placeholders (%d actual count, %d limit)
#
################################################################################ checks if there is any waiting message that exceeds time limit for timeout
alerts.900.idWAITING_MSG_ALERT
alerts.900.limit0
alerts.900.sqlSELECT COUNT(*) FROM message WHERE state WAITING_FOR_RES AND last_update_timestamp (current_timestamp - interval 3600 seconds) 注意每种配置都可以通过JMX即时设置。 预定的工作 OpenHub支持两种类型的计划作业 可以在随机节点上运行并可以同时执行的作业没有条件同时启动作业 无论在哪个节点上群集中只能运行一次的作业请注意我们没有考虑计划的作业只能在特定节点上运行的可能性 OpenHub框架提供了自己的用于作业定义的API。 配置示例 OpenHubQuartzJob(name AsyncPostponedJob, executeTypeInCluster JobExecuteTypeInCluster.NOT_CONCURRENT,simpleTriggers QuartzSimpleTrigger(repeatIntervalMillis 30000))
public void invokePostponedJob() {}OpenHubQuartzJob(name MoreTriggerJob, executeTypeInCluster JobExecuteTypeInCluster.CONCURRENT,cronTriggers {QuartzCronTrigger(cronExpression 0 00 23 ? * *,name FirstTriggerForJob,group MoreTriggerGroup),QuartzCronTrigger(cronExpression 0 00 10 ? * *,misfireInstruction CronTriggerMisfireInstruction.FIRE_ONCE_NOW,name SecondTriggerForJob,group MoreTriggerGroup)},simpleTriggers {QuartzSimpleTrigger(repeatIntervalMillis 10000,repeatCount 20,name ThirdTriggerForJob,group MoreTriggerGroup),QuartzSimpleTrigger(repeatIntervalProperty ASYNCH_PARTLY_FAILED_REPEAT_TIME_SEC,intervalPropertyUnit SimpleTriggerPropertyUnit.SECONDS,misfireInstruction SimpleTriggerMisfireInstruction.FIRE_NOW,name FourthTriggerForJob,group MoreTriggerGroup)})
public void invokeJob() {}请求/响应跟踪 请求/响应跟踪功能允许将路由之间的内部通信或与外部系统的通信保存到数据库中。 之后您可以直接进入数据库并浏览请求和响应表或者查看管理控制台。 消息详细信息–请求/响应跟踪 错误处理 Apache Camel中有一个基本的错误处理 但是OpenHub框架有其自己的概念来处理错误 有自己的带有基本IntegrationException的异常层次结构 错误目录定义了带有描述的唯一错误代码–这有助于识别源系统中的问题 错误目录显示在管理控制台中 错误目录 翻译自: https://www.javacodegeeks.com/2017/11/openhub-framework-next-interesting-features.html