限制 Mule JDBC 入站中的线程数
Limit number of threads in Mule's JDBC inbound
我有一个 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' 无效。
一个 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>
我有一个 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' 无效。
一个 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>