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

    <jms:activemq-connector name="jmsConnector"
                            acknowledgementMode="CLIENT_ACKNOWLEDGE"/>

    <jms:endpoint name="in" queue="in" connector-ref="jmsConnector"/>
    <jms:endpoint name="middle" queue="middle" connector-ref="jmsConnector"/>
    <jms:endpoint name="out" queue="out" connector-ref="jmsConnector"/>

    <jms:object-to-jmsmessage-transformer name="ObjectToJMSMessage"/>

    <model name="jmsTest">

        <service name="InputPart">
            <inbound>
                <inbound-endpoint ref="in">
                    <jms:transaction action="BEGIN_OR_JOIN"/>
                </inbound-endpoint>
            </inbound>
            <component>
                <singleton-object class="org.mule.tck.functional.FunctionalTestComponent">
                    <property key="returnMessage" value="OUTPUT MESSAGE"/>
                </singleton-object>
            </component>
            <outbound>
                <outbound-pass-through-router>
                    <outbound-endpoint ref="middle" transformer-refs="ObjectToJMSMessage"/>
                </outbound-pass-through-router>
            </outbound>
        </service>

        <service name="JmsClientAcknowledgeTransactionFactory">
            <inbound>
                <inbound-endpoint ref="middle">
                    <jms:transaction action="ALWAYS_BEGIN"/>
                </inbound-endpoint>
            </inbound>
            <component>
                <singleton-object class="org.mule.tck.functional.FunctionalTestComponent">
                    <property key="returnMessage" value="OUTPUT MESSAGE"/>
                </singleton-object>
            </component>
            <outbound>
                <outbound-pass-through-router>
                    <outbound-endpoint ref="out" transformer-refs="ObjectToJMSMessage"/>
                </outbound-pass-through-router>
            </outbound>
        </service>

    </model>

</mule>
