开发者

How to configure 2.6 spring: Failed to create route route2 at:

开发者 https://www.devze.com 2023-02-25 14:20 出处:网络
I\'m trying to upgrade from Camel 2.0 to 2.6 I have this in my applicationContext-camel.xml file... <camel:route >

I'm trying to upgrade from Camel 2.0 to 2.6

I have this in my applicationContext-camel.xml file...

<camel:route >
<camel:from uri="transactionSaleBuffer" />
<camel:policy ref="routeTransactionPolicy"/>
<camel:transacted ref="transactionManagerETL" />
<camel:to uri="detailFactProcessor" />
</camel:route>

by adding in the two lines in the middle (policy and transacted) I get the exception...

Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route2 at: >>> F开发者_高级运维rom[transactionSaleBuffer] <<< in route: Route[[From[transactionSaleBuffer]] -> [Tr ansacted[ref:trans... because of Route route2 has no output processors. You need to add outputs to the route such as to("log:foo").

I can see this is because the Camel class RouteDefinition.java makes a call to ProcessorDefinitionHelper.hasOutputs(outputs, true).

This passes in an array of one Object ([Transacted[ref:transactionManagerETL]])

This one object has one two children

[Transacted[ref:transactionManagerETL]]
CHILD-[Policy[ref:routeTransactionPolicy], 
CHILD-To[detailFactProcessor]

The Policy child has no outputs, so the exception is thrown.

Yet I don't know how to add a child, my XML above matches the schema.

Maybe I'm missing something else?

My setup matches the example...Apache Camel: Book in One Page (See section: Camel 1.x - JMS Sample)

Can anyone please help me out. Thanks! Jeff Porter


Try as follows

<camel:route>
  <camel:from uri="transactionSaleBuffer" />
  <camel:transacted ref="transactionManagerETL" />
  <camel:policy ref="routeTransactionPolicy">
    <camel:to uri="detailFactProcessor" />
  </camel:policy>
</camel:route>
0

精彩评论

暂无评论...
验证码 换一张
取 消