基于时间间隔的节流 [英] Throttling based on time interval

查看:101
本文介绍了基于时间间隔的节流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ActiveMq中有4个队列,应该将每个队列中的消息发送到外部服务,以便从队列中提取消息(我正在使用Apache Camel,并且正在对消息进行节流)。
但是我的问题是针对不同的队列,我有不同的社交时间,例如像这样,
队列1消息仅应在上午6点至下午5点之间发送,
队列2消息应仅在上午10点至晚上10点之间发送。

I have 4 queues in ActiveMq and messages from each queue should be sent out to external service, for picking up the messages from queue i am using Apache Camel and i am throttling the messages. But my problem here is for different queues i have different social hours, For E.g. Queue 1 messages should be sent only between 6AM to 5PM, Queue 2 messages should be sent only between 10AM to 10PM like that.

我想知道我们可以使用Apache骆驼节流来解决这个问题。或请提出一些解决方案。

So i want to know can we handle this using Apache camel throttling. Or please suggest me some solution.

让我知道是否有人解决我的问题。

Let me know if anyone not cleared with my problem. ThankU in advance.

推荐答案

Camel允许您将路由与路由策略相关联。而且我们有一个基于骆驼石英的现成策略,并且是基于计划的。这样一来,您就可以为路线的开放时间设置策略。

Camel allows you to associate route(s) with route policies. And we have an out of the box policy that is based on camel-quartz and is scheduled based. This allows you to setup policies for opening hours of your routes.

文档从此处开始: http://camel.apache.org/routepolicy 。并且从该页面到基于调度程序的策略都有链接。

The doc starts here: http://camel.apache.org/routepolicy. And there is links from that page to the the scheduler based policies.

请记住,有一张票- http://issues.apache.org/jira/browse/CAMEL-5929 -关于重新启动应用程序服务器,则路由未启动如果您在开放时间内开始。例如,您有12 pm-6pm。然后在下午3点(例如,在两者之间)重新启动应用程序。然后,我第二天就开始了这条路线。凭单可以让您配置为在打开窗口中启动时强制启动。

Mind there is a ticket - http://issues.apache.org/jira/browse/CAMEL-5929 - about if you restart the app server, then the route is not started if you start within the opening hours. eg your have 12pm-6pm. And you restart the app at 3pm (eg in between). Then the route i started on the next day. The ticket is there to allow you to configure to force start if being started within the opening window.

这篇关于基于时间间隔的节流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆