182.11. 使用具有原生查询的消费者
对于只消耗所选实体,您可以使用 consumer.nativeQuery
URI 查询选项。您只需要定义原生查询选项:
from("jpa://org.apache.camel.examples.MultiSteps?consumer.nativeQuery=select * from MultiSteps where step = 1") .to("bean:myBusinessLogic");
from("jpa://org.apache.camel.examples.MultiSteps?consumer.nativeQuery=select * from MultiSteps where step = 1")
.to("bean:myBusinessLogic");
如果使用原生查询选项,您将收到消息正文中的对象数组。