90.10. 使用 @XPath Annotation 用于 Bean 集成
您可以使用 Bean 集成 在 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
}
}