10.7.7.2. 第 II 部分
当 direct:abc
端点收到消息时,上述验证器会应用到以下路由定义。
注意
inputTypeWithValidate
被使用在 Java DSL 中而不是 inputType
,在 XML DSL 中将 inputType 声明中的 verify 属性设置为 true
:
Java DSL:
from("direct:abc") .inputTypeWithValidate("xml:ABCOrder") .log("${body}");
XML DSL:
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="direct:abc"/> <inputType urn="xml:ABCOrder" validate="true"/> <log message="${body}"/> </route> </camelContext>