通过 Spring DSL 进行分词 header

Split header with tokenize by Spring DSL

它说 https://camel.apache.org/components/latest/eips/split-eip.html#_using_tokenizer_from_spring_xml_extensions 你可以使用 Spring DSL 中的 tokenizer 表达式来拆分主体或 headers 使用令牌.

如何使用标记化拆分 header(例如,我在 header 中使用名称 'split' 字符串“A@B@C”,我需要按标记拆分它"@")?

我以为我可以按如下方式做

<split>
      <header>split</header>
      <tokenize token="@"/>
      <to uri="mock:result"/> 
</split>

但是当我保存这段代码时,出现错误

java.lang.RuntimeException: validation error: cvc-complex-type.2.4.a: Invalid content was found starting with element 'tokenize'. One of '{"http://camel.apache.org/schema/spring":aop, "http://camel.apache.org/schema/spring":aggregate, "http://camel.apache.org/schema

骆驼版本 2.25.1

我找到了一个解决方案,标记化语言有一个选项 'headerName'(要标记化的 header 的名称,而不是使用消息 body)https://camel.apache.org/components/latest/languages/tokenize-language.html。 这行得通

<split>
  <tokenize headerName="split" token="@"/>
  <to uri="mock:result"/>
</split>