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

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

    <quartz:endpoint name="schedulerEndpoint" jobName="myService" repeatInterval="1000">
        <quartz:endpoint-polling-job>
            <quartz:job-endpoint address="vm://event.queue"/>
        </quartz:endpoint-polling-job>
    </quartz:endpoint>

    <model name="quartz-dispatcher">
        <service name="quartzSchedulingService">
            <inbound>
                <inbound-endpoint ref="schedulerEndpoint"/>
            </inbound>
            <outbound>
                <outbound-pass-through-router>
                    <outbound-endpoint address="vm://quartz.in"/>
                </outbound-pass-through-router>
            </outbound>
        </service>

        <service name="scheduledService">
            <inbound>
                <inbound-endpoint address="vm://quartz.in"/>
            </inbound>
            <test:component/>
        </service>
    </model>
</mule>
