<?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"
       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">

    <message-properties-transformer name="hop1ResponseEnricher">
        <add-message-property key="TICKET" value="hop1"/>
    </message-properties-transformer>
    <message-properties-transformer name="hop2enricher">
        <add-message-property key="TTL" value="10000"/>
    </message-properties-transformer>

    <endpoint name="inboundEndpoint" address="vm://inbound"/>
    <endpoint name="hop1Endpoint" address="vm://hop1"/>
    <endpoint name="hop2Endpoint" address="vm://hop2"/>

    <model name="main">
        <service name="chainingComponent">
            <inbound>
                <inbound-endpoint ref="inboundEndpoint" synchronous="true"/>
                <forwarding-router/>
            </inbound>
            <outbound>
                <chaining-router>
                    <outbound-endpoint ref="hop1Endpoint"/>
                    <outbound-endpoint ref="hop2Endpoint"/>
                </chaining-router>
            </outbound>
        </service>

        <service name="hop1Service">
            <inbound>
                <inbound-endpoint ref="hop1Endpoint" responseTransformer-refs="hop1ResponseEnricher"/>
            </inbound>
            <component>
                <singleton-object class="org.mule.tck.functional.FunctionalTestComponent"/>
            </component>
        </service>

        <service name="hop2Service">
            <inbound>
                <inbound-endpoint ref="hop2Endpoint" transformer-refs="hop2enricher"/>
            </inbound>
            <component>
                <singleton-object class="org.mule.tck.functional.FunctionalTestComponent"/>
            </component>
        </service>
    </model>
</mule>
