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