我是 WSO2 和 Apache Synapse 的新手。我做了一个代理服务来将一些文件路由到另一个文件夹,但是当我查看 JConsole 时,只有一个线程在工作。
如何配置设置以使多个线程同时工作并处理同一个源文件夹?我像这样配置线程池:
-Dsnd_t_core=3 \
-Dsnd_t_max=5000 \
-Dsnd_qlen=-1 \
我的代理服务如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
<parameter name="cachableDuration">15000</parameter>
</registry>
<proxy name="Service1"
transports="vfs"
startOnLoad="true"
trace="enable"
statistics="enable">
<description/>
<target>
<inSequence>
<log level="custom">
<property name="Message" value="Routing start"/>
<property name="filename"
expression="fn:concat(get-property('transport', 'FILE_NAME'), '.xml')"/>
</log>
</inSequence>
<outSequence>
<property name="OUT_ONLY" value="true"/>
</outSequence>
</target>
<parameter name="transport.vfs.Streaming">false</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.PollInterval">1</parameter>
<parameter name="transport.vfs.FileURI">file:///home/user/test/target2</parameter>
<parameter name="transport.vfs.MoveAfterProcess">file:///home/user/test/target</parameter>
<parameter name="transport.vfs.MoveAfterFailure">file:///home/user/test/failure</parameter>
<parameter name="transport.vfs.Locking">disable</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.*</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>
<sequence name="fault">
<log>
<property name="MESSAGE" value="Executing default "fault" sequence"/>
<property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
<property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
</log>
<drop/>
</sequence>
<sequence name="main">
<in>
<filter source="get-property('To')" regex="http://localhost:9000.*">
<send/>
</filter>
</in>
<out>
<send/>
</out>
<description>The main sequence for the message mediation</description>
</sequence>
</definitions>