我有一个骆驼路线,在接收大量信息时会受到限制。 假设我定义的最大交换是每2秒3个,并且路由收到的超过我想要将这些消息重定向到其他负载均衡器路由的限制。 有人可以帮助我如何实现它?
I have a camel route which will be throttled on recieving loads of messages. Suppose the maximum exchanges i defined is 3 per 2 seconds and the route recieves more than the limit i want to redirect those messages to some other load balancer route. Can someone help me how to achieve it??
最满意答案
如果我正确理解您的问题,您希望限制收到的消息,然后将这些消息权衡到不同的路由或系统。
from("SomethingSendingMeMessages") .throttle(3) .loadbalance().roundRobin() .to("place1", "place2", "place3") .end();如果您需要将限制路由发送到包含负载均衡器的第二个路由,您可以执行以下操作:
from("SomethingSendingMeMessages") .throttle(3) .to("direct:mySecondRoute"); from("direct:mySecondRoute") .loadbalance().roundRobin() .to("place1", "place2", "place3") .end();您可以探索的另一个选项是在负载均衡器之后限制以控制每个单独路由的方法。
from("SomethingSendingMeMessages") .loadbalance().roundRobin() .to("direct:place1", "direct:place2") .end(); from("direct:place1") .throttle(3) .to("myOtherWork"); from("direct:place2") .throttle(3) .to("myOtherWork");If I am understanding your question right you want to throttle your incoming messages then loadbalance those messages out to a different route or system.
from("SomethingSendingMeMessages") .throttle(3) .loadbalance().roundRobin() .to("place1", "place2", "place3") .end();If you need to have the throttling route send to a second route that contains the loadbalancer you can do it like follows:
from("SomethingSendingMeMessages") .throttle(3) .to("direct:mySecondRoute"); from("direct:mySecondRoute") .loadbalance().roundRobin() .to("place1", "place2", "place3") .end();Another option you could explore is throttling after the loadbalancer to control each individual route's method.
from("SomethingSendingMeMessages") .loadbalance().roundRobin() .to("direct:place1", "direct:place2") .end(); from("direct:place1") .throttle(3) .to("myOtherWork"); from("direct:place2") .throttle(3) .to("myOtherWork");更多推荐
route,限制,messages,电脑培训,计算机培训,IT培训"/> <meta name="description
发布评论