首页 > 解决方案 > camel-exec :找不到端点错误

问题描述

下面是消费者端点。尝试使用 camel exec 进程 uri 执行 linux/unix 命令。

<recipientList>
    <simple>exec:bash?args=-c CFTUTIL SEND IDF=${property[cftFlowIdentifier]}, PART=${property[cftParterName]}, FNAME=${property[cftFullFilePath]}, FNAME=${property[cftDestinationPath]}/${property[cftFileName]}</simple>
</recipientList>

高于端点导致以下错误..

org.apache.camel.NoSuchEndpointException: No endpoint could be found for: PART=

请检查使用 camel exec uri 调用上述命令是否有任何问题。相同的命令在普通的 java 程序中成功执行。

标签: apache-camel

解决方案


Recipient List EIP接受以逗号分隔的端点列表。如果您需要在 URL 中使用逗号,则禁用或使用其他分隔符。

<recipientList delimiter="false">
   <simple>...</simple>
</recipientList>

你也可以切换到To D EIP,这样更适合你的需求,因为你只调用一个端点。

<toD uri="exec:bash?args=-c CFTUTIL SEND IDF=${property[cftFlowIdentifier]}, PART=${property[cftParterName]}, FNAME=${property[cftFullFilePath]}, FNAME=${property[cftDestinationPath]}/${property[cftFileName]}"/>

推荐阅读