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

    <!-- yes, this is a standard filter, but the test here is for custom filter
         so please don't "fix" -->

    <custom-filter name="consonant-filter" class="org.mule.routing.filters.RegExFilter">
        <spring:property name="pattern" value="^[bcdfghjklmnpqrstvwxyz]+$"/>
    </custom-filter>

    <model name="model">

        <service name="service">
            <inbound>
                <vm:inbound-endpoint path="in" connector-ref="default"/>
                <forwarding-router/>
            </inbound>
            <outbound>
                <filtering-router>
                    <vm:outbound-endpoint path="vowels" connector-ref="queue"/>
                    <custom-filter class="org.mule.routing.filters.RegExFilter">
                        <spring:property name="pattern" value="^[aeiou]+$"/>
                    </custom-filter>
                </filtering-router>
                <filtering-router>
                    <vm:outbound-endpoint path="consonants" connector-ref="queue"/>
                    <filter ref="consonant-filter"/>
                </filtering-router>
            </outbound>
        </service>

    </model>

</mule>
