简体   繁体   English

如何在WSO2 ESB 4.9.0中的JMS代理上设置限制

[英]How to set throttling on JMS proxy in WSO2 ESB 4.9.0

We are facing an issue with MQ JMS proxy in WSO2 ESB 4.9.0 when bulk messages are pilled up on Queue. 当在队列上堆积大量消息时,我们面临WSO2 ESB 4.9.0中的MQ JMS代理问题。

Back end services invoked by proxy can process only 50 requests per second and beyond that our back end services will fail. 代理调用的后端服务每秒只能处理50个请求,超过此数量,我们的后端服务将失败。

The issue here is, when messages are pilled up on the Queue (1000messages), proxy is reading all the messages from the queue and sending to back end services & back end services are failing. 这里的问题是,当消息堆积在队列上(1000个消息)时,代理从队列中读取所有消息,并且发送到后端服务和后端服务失败。

Is there any setting that we can set to on proxy to control message read by proxy service. 我们可以在代理服务器上设置任何设置来控制代理服务读取的消息吗?

Here the main problem is proxy is very quick to read messages from Queue and flooding back end services. 这里的主要问题是代理服务器非常快速地从Queue中读取消息并向后端服务泛洪。 Back end services are failing because they are not designed to handle higher load 后端服务失败,因为它们不能处理更高的负载

如果您需要侦听JMS队列并想以受控方式将消息发送到后端服务,则必须使用消息存储消息处理器

You can define parameters in your proxy service : 您可以在代理服务中定义参数:

<parameter name="transport.jms.ConcurrentConsumers">1</parameter>
<parameter name="transport.jms.MaxMessagesPerTask">1</parameter>
<parameter name="transport.jms.MaxConcurrentConsumers">1</parameter>

(adapt these values to your needs) (使这些值适合您的需求)

Furthermore, if you send a message to a back end service, you can choose to send it in a synchronous manner, using call mediator with blocking="true" : your proxy won't dequeue next jms message until it receive the response from your backend service. 此外,如果您将消息发送到后端服务,则可以选择以同步方式发送消息,方法是使用带有具有阻塞=“ true”的调用介体:在收到您的响应之前,您的代理不会使下一个jms消息出队。后端服务。 If, on the other hand, you use send mediator, it's asynchronous : your mediation will continue while an other thread (callback) wait for the response and therefore, your proxy will dequeue next jms message 另一方面,如果您使用发送中介器,则它是异步的:您的中介将继续,而另一个线程(回调)将等待响应,因此,您的代理将使下一个jms消息出队

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM