我有一个jdbc入站端点,可以选择数万条记录。 Mule自动将它们吐出并同时处理它们中的每一个。问题是,该过程涉及调用另一个无法同时处理这么多请求的服务。 有没有办法限制并发线程的数量,以便不是同时发生那么多请求? 我正在阅读http://www.mulesoft.org/documentation/display/current/Configuring+a+Transport#ConfiguringaTransport-receiver,但我无法理解如何去做。我试过了:
<jdbc-ee:inbound-endpoint doc:name="db" connector-ref="testConnector" exchange-pattern="one-way" pollingFrequency="60000" queryTimeout="-1" queryKey="findAllPersonIds">
<receiver-threading-profile maxThreadsActive="2" />
</jdbc-ee:inbound-endpoint>
但是当我尝试启动它时,Mule抱怨'receiver-threading-profile'无效。
答案 0 :(得分:0)
JDBC入站端点是一个轮询器端点,每个Mule实例由一个线程支持(如果运行EE,则由每个群集支持)。
您遇到的并行性来自流处理策略,默认情况下,该策略具有将使用多个并发线程的线程配置文件。
您需要为执行远程HTTP调用的流限制此并行性。您还没有显示您的配置,因此我无法判断它与入站JDBC端点的流程是否相同。
根据您提供的信息,我能做的最好的事情就是引导您参考参考文档:http://www.mulesoft.org/documentation/display/current/Flow+Processing+Strategies
从这个文档中,这是一个将使用500个并发线程的流程:
<queued-asynchronous-processing-strategy name="allow500Threads"
maxThreads="500"/>
<flow name="manyThreads" processingStrategy="allow500Threads">
<vm:inbound-endpoint path="manyThreads" exchange-pattern="one-way"/>
<vm:outbound-endpoint path="output" exchange-pattern="one-way"/>
</flow>