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

    <!-- Testing with ActiveMq -->
    <jms:activemq-connector name="jmsConnector" />

    <vm:connector name="vmConnector" queueEvents="true" />

    <model name="NestedRouter">

        <service name="HelloComponent">
            <inbound>
                <inbound-endpoint address="vm://hello.in" />
                <inbound-endpoint address="jms://hello.in" />
                <inbound-endpoint address="jms://topic:thello.in" />
            </inbound>
            <component class="org.mule.test.integration.routing.nested.HelloService" />
        </service>

        <service name="InvokerComponent">
            <inbound>
                <inbound-endpoint address="vm://invoker.in" />
            </inbound>
            <component>
                <singleton-object class="org.mule.test.integration.routing.nested.Invoker" />
                <binding interface="org.mule.test.integration.routing.nested.HelloInterface">
                    <outbound-endpoint address="vm://hello.in" synchronous="true" />
                </binding>
            </component>
            <outbound>
                <outbound-pass-through-router>
                    <outbound-endpoint address="vm://invoker.out" />
                </outbound-pass-through-router>
            </outbound>
        </service>

        <service name="JmsQueueInvokerComponent">
            <inbound>
                <inbound-endpoint address="jms://invoker.in" />
            </inbound>
            <component>
                <singleton-object class="org.mule.test.integration.routing.nested.Invoker" />
                <binding interface="org.mule.test.integration.routing.nested.HelloInterface">
                    <outbound-endpoint address="jms://hello.in" remoteSync="true" />
                </binding>
            </component>
            <outbound>
                <outbound-pass-through-router>
                    <outbound-endpoint address="jms://invoker.out" />
                </outbound-pass-through-router>
            </outbound>
        </service>

        <service name="JmsTopicInvokerComponent">
            <inbound>
                <inbound-endpoint address="jms://topic:tinvoker.in" />
            </inbound>
            <component>
                <singleton-object class="org.mule.test.integration.routing.nested.Invoker" />
                <binding interface="org.mule.test.integration.routing.nested.HelloInterface">
                    <outbound-endpoint address="jms://topic:thello.in" remoteSync="true" />
                </binding>
            </component>
            <outbound>
                <outbound-pass-through-router>
                    <outbound-endpoint address="jms://topic:tinvoker.out" />
                </outbound-pass-through-router>
            </outbound>
        </service>

    </model>
</mule>