<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE mule-configuration PUBLIC "-//MuleSource //DTD mule-configuration XML V1.0//EN"
                                "http://mule.mulesource.org/dtds/mule-configuration.dtd">

<mule-configuration id="test" version="1.0">

    <mule-environment-properties synchronous="false" synchronousEventTimeout="5000" />

    <!-- Embed Spring configuration to create a Jms Connection factory -->
    <container-context className="org.mule.module.spring.SpringContainerContext">
        <properties>
            <text-property name="configuration">
                <![CDATA[
                <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
                <beans>
                    <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
                        <property name="brokerURL"><value>vm://localhost?broker.persistent=false&amp;broker.useJmx=false</value></property>
                    </bean>
                </beans>
                ]]>
            </text-property>
        </properties>
    </container-context>

    <!-- Transaction manager -->
    <transaction-manager
        factory="org.mule.module.jotm.JotmTransactionManagerFactory"/>

    <connector name="jmsConnector" className="org.mule.transport.jms.activemq.ActiveMqJmsConnector">
        <properties>
            <!-- The ActiveMQ ConnectionFactory is configured as a Spring bean. -->
            <container-property name="connectionFactory" reference="jmsConnectionFactory"/>
            <property name="specification" value="1.1"/>
        </properties>
    </connector>

    <model name="model">

        <mule-descriptor name="component1"
            implementation="org.mule.tck.testmodels.services.TestReceiver">
            <inbound-router>
                <endpoint address="vm://component1"/>
            </inbound-router>
            <outbound-router>
                <router className="org.mule.routing.outbound.MulticastingRouter">
                    <endpoint address="jms://my.queue1">
                        <transaction action="ALWAYS_JOIN" factory="org.mule.transport.jms.JmsTransactionFactory"/>
                    </endpoint>
                    <endpoint address="jms://my.queue2">
                        <transaction action="ALWAYS_JOIN" factory="org.mule.transport.jms.JmsTransactionFactory"/>
                    </endpoint>
                    <transaction action="ALWAYS_BEGIN" factory="org.mule.transport.jms.JmsTransactionFactory"/>
                </router>
            </outbound-router>
        </mule-descriptor>

        <mule-descriptor name="component2"
            implementation="org.mule.tck.testmodels.services.TestReceiver">
            <inbound-router>
                <endpoint address="jms://component2">
                    <transaction action="ALWAYS_BEGIN" factory="org.mule.transport.jms.JmsTransactionFactory"/>
                </endpoint>
            </inbound-router>
            <outbound-router>
                <router className="org.mule.routing.outbound.MulticastingRouter">
                    <endpoint address="jms://my.queue3"/>
                    <endpoint address="jms://my.queue4"/>
                </router>
            </outbound-router>
        </mule-descriptor>
    </model>
</mule-configuration>
