0

我需要在两个不同的应用程序中从另一个流(客户端)调用一个流(服务器)。我不希望创建服务器的 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 调用是一种更清洁的解决方案。我错了吗?谢谢

4

1 回答 1

1

VM 目前(Mule 3.4)仅用于同一应用程序内的调用:要执行远程调用,最简单的是使用 HTTP。

于 2013-09-18T15:49:08.177 回答