将属性发送到seda队列

时间:2017-03-17 12:22:43

标签: apache-camel

我有一条路线,我试图将其称为seda队列。我想使用已在当前路径中设置到seda队列的属性。下面是我使用过的一段代码,但它似乎没有按预期工作。

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route id="route1">
       <!-- Method initialize the JobDetails class with values jobName="jobTest" and jobMode="mode1" -->
       <bean ref="jobDetails" method="createJobDetails"/>
       <to uri="activemq:queue:myqueue?disableReplyTo=true" />
     </route>

     <route id="route2">
      <from uri="activemq:queue:myqueue" />
      <convertBodyTo type="my.package.JobDetails" />

      <setProperty propertyName="JOB_DETAILS">
        <simple>${body}</simple>
      </setProperty>

      <recipientList>
        <simple>direct-vm:testDirect-${property.JOB_DETAILS.jobName}</simple>
      </recipientList>
     </route>
</camelContext>

<camelContext xmlns="http://camel.apache.org/schema/blueprint">
 <route id="route3">
    <from uri="direct-vm:testDirect-jobTest" />
    <!-- Some business logic based on the job mode-->
    <setProperty propertyName="JOB_MODE">
        <simple>mode1</simple>
    </setProperty>

    <to uri="seda:testSeda?blockWhenFull=true" />
  </route>

  <route id="sedaRoute">
    <from uri="seda:testSeda?concurrentConsumers=5" />
    <log message="Message from firstRoute: ${property.JOB_MODE}" />
    <!-- Perform some business logic based on the job mode -->
  </route>  
 </camelContext>

赞赏的帮助!!!

0 个答案:

没有答案