我有一条路线,我试图将其称为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>
赞赏的帮助!!!