我正在尝试使用deadLetterChannelBuilder,但无法为其找到正确的属性。有谁知道它们是什么或在哪里找到它们?文档中的那个似乎不起作用。 ?
无法在类org.apache.camel.builder.DeadLetterChannelBuilder上找到属性描述符useOriginalBody
<bean id="deadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="deadLetterUri" value="${deadLetterQueue}"/>
<property name="redeliveryPolicy" ref="redeliveryPolicyConfig"/>
<property name="useOriginalBody" value="true" />
</bean>
<bean id="redeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
<property name="maximumRedeliveries" value="3"/>
<property name="redeliveryDelay" value="5000" />
</bean>
<camelContext
id="com.ge.ip.mro.coreCamelContext"
trace="true"
xmlns="http://camel.apache.org/schema/blueprint"
allowUseOriginalMessage="false"
streamCache="true"
errorHandlerRef="deadLetterErrorHandler" >
我也尝试过allowUseOriginalMessage,但正如预期的那样,它不是deadLetterChannelBuilder属性。
答案 0 :(得分:1)
正确的属性称为$string = "I have some fruits like [name], [another_name] and [one_another_name]";
$fruits_array = array("Banana", "Apple", "Orange");
$string = preg_replace_callback(
'/\[[^]]+\]/',
function ($matches) use (&$fruits_array) {
return array_shift($fruits_array);
},
$string
);
echo $string;
。
useOriginalMessage