我需要在两个不同的应用程序中从另一个流(客户端)调用流(服务器)。 我不想创建服务器的jar并将其包含在客户端中,如下所述: http://www.mulesoft.org/documentation/display/current/Sharing+Custom+Configuration+Fragments
我尝试使用vm入站/出站组件,但它不起作用,这里是配置文件。
对于客户流程:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/current/mule-quartz.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">
<quartz:connector name="quartzConnector_vm" validateConnections="true" doc:name="Quartz">
<quartz:factory-property key="org.quartz.scheduler.instanceName" value="MuleSchedulerClient1"/>
<quartz:factory-property key="org.quartz.threadPool.class" value="org.quartz.simpl.SimpleThreadPool"/>
<quartz:factory-property key="org.quartz.threadPool.threadCount" value="3"/>
<quartz:factory-property key="org.quartz.scheduler.rmi.proxy" value="false"/>
<quartz:factory-property key="org.quartz.scheduler.rmi.export" value="false"/>
<quartz:factory-property key="org.quartz.jobStore.class" value="org.quartz.simpl.RAMJobStore"/>
</quartz:connector>
<flow name="scheduleFlow2" doc:name="scheduleFlow2">
<quartz:inbound-endpoint jobName="myQuartzJobName2" repeatInterval="7000" responseTimeout="10000" doc:name="Quartz">
<quartz:event-generator-job groupName="DEFAULT" jobGroupName="DEFAULT">
</quartz:event-generator-job>
</quartz:inbound-endpoint>
<expression-component doc:name="Expression"><![CDATA[payload="test";]]></expression-component>
<vm:outbound-endpoint exchange-pattern="request-response" path="dispatchSingleConfiguration" doc:name="VM">
<vm:transaction action="NONE"/>
</vm:outbound-endpoint>
</flow>
服务器流程就像这样:
<flow name="prepareInputData" doc:name="prepareInputData">
<vm:inbound-endpoint exchange-pattern="request-response" path="dispatchSingleConfiguration" doc:name="VM">
<vm:transaction action="NONE"/>
</vm:inbound-endpoint>
<set-variable variableName="nomeFileProperties" value="#[payload]" doc:name="Variable"/>
</flow>
是否可以正确设置vm端点中的路径以允许入站/出站VM通信? 我可以使用http调用,但我认为VM调用是一个更清洁的解决方案。 我错了吗?谢谢
答案 0 :(得分:1)
VM目前(Mule 3.4)仅适用于同一应用程序内的呼叫:要执行远程呼叫,最简单的方法是使用HTTP。