<?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:mxml="http://www.mulesource.org/schema/mule/xml/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/xml/2.0 http://www.mulesource.org/schema/mule/xml/2.0/mule-xml.xsd
       http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd">

    <vm:connector name="default"/>
    <vm:connector name="queue" queueEvents="true"/>

    <vm:endpoint name="in" address="vm://in" connector-ref="default"/>

    <model name="property extractor test">

        <service name="test">
            <inbound>
                <inbound-endpoint ref="in"/>
                <forwarding-router/>
            </inbound>
            <outbound>
                <exception-based-router>
                    <outbound-endpoint address="vm://unreliable" connector-ref="default"/>
                    <vm:outbound-endpoint path="error" connector-ref="queue"/>
                </exception-based-router>
            </outbound>
        </service>

        <service name="unreliable">
            <inbound>
                <vm:inbound-endpoint address="vm://unreliable" connector-ref="default"/>
                <forwarding-router/>
            </inbound>
            <outbound>
                <!-- this property is set from the test case as something like "${bean:childBean.value}"
                 or ${xpath:/endpoints/endpoint}
                 -->
                <endpoint-selector-router evaluator="custom" custom-evaluator="${selector.evaluator}" expression="${selector.expression}">
                    <!-- this could be a global endpoint too once MULE-2595  is fixed -->                    
                    <vm:outbound-endpoint name="matchingEndpoint1" path="match1" connector-ref="queue"/>
                    <outbound-endpoint name="matchingEndpoint2" address="vm://match2" connector-ref="queue"/>
                </endpoint-selector-router>
            </outbound>
        </service>

    </model>

</mule>
