我正在尝试在 Camel 2.23.2 中设置自定义 processStrategy。我尝试了几种方法从processStrategy uri 参数中引用它,但我总是得到这个异常:
Caused by: java.lang.IllegalArgumentException: Could not find a suitable setter for property: processStrategy as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: org.apache.camel.component.file.GenericFileProcessStrategy with value #genericFileNoOpProcessStrategy"
路线定义
<bean id="genericFileNoOpProcessStrategy" class="org.apache.camel.component.file.strategy.GenericFileNoOpProcessStrategy"/>
<routeContext id="routes" xmlns="http://camel.apache.org/schema/spring">
<route id="route">
<from uri="seda:someEvent"/>
<pollEnrich>
<constant>file:/folder?fileName=file.csv&processStrategy=#genericFileNoOpProcessStrategy"</constant>
</pollEnrich>
引用它的正确方法是什么?