spring-xd 使用 xml 负载

spring-xd work with xml payload

是否可以在 spring-XD 运行时使用 XML 负载?我有以下要执行的流:

stream create --name testingXML --definition "file --dir=/tmp/sample.xml 
              --outputType=application/xml | splitter --expression=//item | log"

我的目标是拆分给定的 XPATH 表达式(由 Spring 集成支持)。

当使用 "simple" 拆分器(而不是 XPath 拆分器 - XD 目前没有 XPathSplitter 模块)时,您需要在表达式中使用 #xpath function

此外,XD 当前不支持 --outputType=application/xml 。这意味着不会通过 JAXB 等将有效负载自动转换为 XML。但是如果您的生产模块已经发出 XML,则不需要它。