Apache camel CronScheduledrutepolicy在开关站未按预期运行

Apache camel CronScheduledrutepolicy在开关站未按预期运行,apache-camel,jbossfuse,switchyard,Apache Camel,Jbossfuse,Switchyard,我试图在camel route中实现CronScheduledrutePolicy,但它并没有按预期工作。我希望开关站路线在cron触发器处停止和启动。我在路由定义中添加了routePolicyRef=“customRoutePolicy”和AutoStart=“false”属性 日志: Iam尝试类似于此,仅在cron触发期间才需要从队列中拾取消息,但一旦部署完成,连接的组件就会开始侦听队列。 你能告诉我可能有什么问题吗 骆驼路线: <?xml version="1.0" encodin

我试图在camel route中实现CronScheduledrutePolicy,但它并没有按预期工作。我希望开关站路线在cron触发器处停止和启动。我在路由定义中添加了routePolicyRef=“customRoutePolicy”和AutoStart=“false”属性

日志:

Iam尝试类似于此,仅在cron触发期间才需要从队列中拾取消息,但一旦部署完成,连接的组件就会开始侦听队列。 你能告诉我可能有什么问题吗

骆驼路线:

<?xml version="1.0" encoding="ASCII"?>
<routes xmlns="http://camel.apache.org/schema/spring">
    <route streamCache="true" routePolicyRef="customRoutePolicy" autoStartup="false">
         <from uri="switchyard://ESBService" />
        <log message="Header is: ${headers.ResponseType}" />
        <choice>
            <when>
                <simple>${headers.ResponseType} == 'XMLANDPDF'</simple>
                <bean ref="CreateStub" method="setAttachmentInHeader()" />
                <to uri="xslt:xslt/create-response.xslt" />
            </when>
            <otherwise>
                <bean ref="CreateStub" method="setAttachmentInBody()" />
            </otherwise>
        </choice>
        <log message="Response is: ${body}" />
    </route>
</routes>
开关站xml:

<?xml version="1.0" encoding="UTF-8"?>
<sy:switchyard xmlns:camel="urn:switchyard-component-camel:config:1.1" xmlns:jms="urn:switchyard-component-camel-jms:config:1.1" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:sy="urn:switchyard-config:switchyard:1.1" name="Thunderhead-POC-PDF" targetNamespace="urn:com.example.switchyard:Thunderhead-POC-PDF:1.0">
  <sca:composite name="Thunderhead-POC-PDF" targetNamespace="urn:com.example.switchyard:Thunderhead-POC-PDF:1.0">
    <sca:component name="Component">
      <camel:implementation.camel>
        <camel:xml path="route.xml"/>
      </camel:implementation.camel>
      <sca:service name="ESBService">
        <sy:interface.esb inputType="java.lang.String" outputType="java.io.InputStream"/>
      </sca:service>
    </sca:component>
    <sca:service name="ESBService" promote="Component/ESBService">
      <sy:interface.esb inputType="java.lang.String" outputType="java.io.InputStream"/>
      <jms:binding.jms name="jms1">
        <jms:contextMapper includes="sourceSystemID.*,ResponseType.*"/>
        <jms:queue>Document.Eu.In.Deferred</jms:queue>
        <jms:connectionFactory>#ConnectionFactory</jms:connectionFactory>
        <jms:replyTo>Document.Eu.Out.Result</jms:replyTo>
      </jms:binding.jms>
    </sca:service>
  </sca:composite>
</sy:switchyard>

Document.Eu.In.延期
#连接工厂
Document.Eu.Out.Result
package com.example.switchyard.Thunderhead_POC_PDF;

import javax.enterprise.inject.Produces;
import javax.inject.Named;

import org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy;
public class MyRoutePolicy{

    @Produces @Named("customRoutePolicy")
    public static CronScheduledRoutePolicy  createRoutePolicy ()
    {
        CronScheduledRoutePolicy policy=new CronScheduledRoutePolicy(); 
        policy.setRouteStartTime("0 27 18 ? * *");
        policy.setRouteStopGracePeriod(10000);
        policy.setRouteStartTime("0 29 18 ? * *");
        return policy;
    } 

}
<?xml version="1.0" encoding="UTF-8"?>
<sy:switchyard xmlns:camel="urn:switchyard-component-camel:config:1.1" xmlns:jms="urn:switchyard-component-camel-jms:config:1.1" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:sy="urn:switchyard-config:switchyard:1.1" name="Thunderhead-POC-PDF" targetNamespace="urn:com.example.switchyard:Thunderhead-POC-PDF:1.0">
  <sca:composite name="Thunderhead-POC-PDF" targetNamespace="urn:com.example.switchyard:Thunderhead-POC-PDF:1.0">
    <sca:component name="Component">
      <camel:implementation.camel>
        <camel:xml path="route.xml"/>
      </camel:implementation.camel>
      <sca:service name="ESBService">
        <sy:interface.esb inputType="java.lang.String" outputType="java.io.InputStream"/>
      </sca:service>
    </sca:component>
    <sca:service name="ESBService" promote="Component/ESBService">
      <sy:interface.esb inputType="java.lang.String" outputType="java.io.InputStream"/>
      <jms:binding.jms name="jms1">
        <jms:contextMapper includes="sourceSystemID.*,ResponseType.*"/>
        <jms:queue>Document.Eu.In.Deferred</jms:queue>
        <jms:connectionFactory>#ConnectionFactory</jms:connectionFactory>
        <jms:replyTo>Document.Eu.Out.Result</jms:replyTo>
      </jms:binding.jms>
    </sca:service>
  </sca:composite>
</sy:switchyard>