当前位置: 动力学知识库 > 问答 > 编程问答 >

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

问题描述:

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: >>> From[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>
分享给朋友:
您可能感兴趣的文章:
随机阅读: