<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:spring="http://www.springframework.org/schema/beans"
       xmlns:client="http://www.mulesource.org/schema/mule/client/2.0"
       xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
       http://www.mulesource.org/schema/mule/client/2.0 http://www.mulesource.org/schema/mule/client/2.0/mule-client.xsd
       http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd">

    <client:remote-dispatcher-agent>
        <!-- this tcp endpoint needs to be synchronous since the the test is expecting a response.-->
        <client:remote-endpoint ref="remoteEndpoint"/>
    </client:remote-dispatcher-agent>

    <!-- this connector/provider simulates an existing endpoint on a remote server -->
    <vm:connector name="vmRemoteQueueConnector" queueEvents="true"/>

    <vm:connector name="vmRemoteConnector" queueEvents="false"/>

    <endpoint address="vm://remote.queue" name="remoteVmQueue"/>
    <endpoint address="vm://remote.endpoint" name="testVmEndpoint" connector-ref="vmRemoteConnector" remoteSync="true"/>

    <model name="model">
        <service name="TestReceiverUMO">
            <inbound>
                <inbound-endpoint address="vm://test.queue" connector-ref="vmRemoteQueueConnector"/>
            </inbound>
            <component class="org.mule.tck.functional.FunctionalTestComponent"/>
            <!--<outbound-router>-->
                <!--<outbound-pass-through-router>-->
                    <!--<outbound-endpoint address="stdio://System.out"/>-->
                <!--</outbound-pass-through-router>-->
            <!--</outbound-router>-->
        </service>

        <service name="remoteUMO">
            <inbound>
                <inbound-endpoint ref="testVmEndpoint"/>
            </inbound>
            <component>
                <singleton-object class="org.mule.component.simple.StaticComponent">
                    <properties>
                        <spring:entry key="data" value="received from remote component"/>
                    </properties>
                </singleton-object>
            </component>
        </service>
    </model>
</mule>
