144.11. 使用 @XPath Annotation 用于 Bean 集成
您可以使用 Bean 集成 在 bean 上调用方法,并使用各种语言(如 @XPath )从消息中提取值并将其绑定到 method 参数。
注意
默认的 @XPath 注释具有 SOAP 和 XML 命名空间。
public class Foo {
@Consume(uri = "activemq:my.queue")
public void doSomething(@XPath("/person/@name") String name, String xml) {
// process the inbound message here
}
}