151.11. 使用 @XPath Annotation 用于 Bean 集成
您可以使用 Bean Integration 对 bean 调用方法,并使用 @XPath 等各种语言从消息中提取值并将其绑定到方法参数。
注意
默认 @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
}
}