57.8. jsonpath 注入
您可以使用 Bean 集成 在 bean 上调用方法,并使用各种语言,如 JSONPath (通过 @JsonPath
注释)从消息中提取值并将其绑定到 method 参数,如下所示:
public class Foo { @Consume("activemq:queue:books.new") public void doSomething(@JsonPath("$.store.book[*].author") String author, @Body String json) { // process the inbound message here } }