Camel-poll-JPA忽略namedQuery

Camel-poll-JPA忽略namedQuery,jpa,apache-camel,Jpa,Apache Camel,使用JPA Consumer、transform和其他中间路线操作制作驼峰ETL路线示例。这包括针对另一JPA实体的额外步骤。pollRich步骤应该使用基于定义的namedQuery的实体数据,该查询带有动态参数(通过先前交换中的#params注册表映射传递)。它完全忽略namedQuery。它还忽略任何在线查询——不管查询有多简单——并简单地将初始记录轮询到maximumResults from("jpa:com.tcfbank.example.entity.PersonEntity?max

使用JPA Consumer、transform和其他中间路线操作制作驼峰ETL路线示例。这包括针对另一JPA实体的额外步骤。pollRich步骤应该使用基于定义的namedQuery的实体数据,该查询带有动态参数(通过先前交换中的#params注册表映射传递)。它完全忽略namedQuery。它还忽略任何在线查询——不管查询有多简单——并简单地将初始记录轮询到maximumResults

from("jpa:com.tcfbank.example.entity.PersonEntity?maxMessagesPerPoll=500&persistenceUnit=cedb&consumer.namedQuery=withOccupationCodeAndValidIdentification&consumer.initialDelay=3000&delay=3000&consumeDelete=false&consumeLockEntity=false")
.convertBodyTo(CanonicalPerson.class)
.to("bean:parameterManager")
.pollEnrich("jpa:com.tcfbank.example.entity.AccountEntity?persistenceUnit=cedb2&consumer.resultClass=com.tcfbank.example.entity.AccountEntity&consumer.namedQuery=byCustomerId&consumer.parameters=#params&consumeDelete=false&consumeLockEntity=false&maximumResults=50", 5000, "accountAggregationStrategy").id("EnrichWithAccounts")
.to("bean:scoringClient")
.setHeader(Exchange.FILE_NAME, el("${in.body.customerId}.xml"))
.to("file:target/customers");

PollRich不是JPA消费者而是pollingconsumer,请从参数中删除前缀consumer

.pollEnrich("jpa:com.tcfbank.example.entity.AccountEntity?persistenceUnit=cedb2&<strike>consumer.</strike>resultClass=com.tcfbank.example.entity.AccountEntity&<strike>consumer.</strike>namedQuery=byCustomerId&<strike>consumer.</strike>parameters=#params&consumeDelete=false&consumeLockEntity=false&maximumResults=50", 5000, "accountAggregationStrategy").id("EnrichWithAccounts")
.pollEnrich(“jpa:com.tcfbank.example.entity.AccountEntity?persistenceUnit=cedb2&consumer.resultClass=com.tcfbank.example.entity.AccountEntity&consumer.namedQuery=byCustomerId&consumer.parameters=#params&consumerdelete=false&consumerlockEntity=false&maximumResults=50”、5000,“accountAggregationStrategy”).id(“EnrichWithAccounts”)