Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F36C18217 for ; Wed, 6 Jan 2016 15:09:59 +0000 (UTC) Received: (qmail 43756 invoked by uid 500); 6 Jan 2016 15:09:59 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 43715 invoked by uid 500); 6 Jan 2016 15:09:59 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Delivered-To: moderator for dev@camel.apache.org Received: (qmail 97489 invoked by uid 99); 6 Jan 2016 14:51:08 -0000 X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.314 X-Spam-Level: **** X-Spam-Status: No, score=4.314 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Date: Wed, 6 Jan 2016 07:50:58 -0700 (MST) From: "web_nabble@sunilsamuel.com" To: dev@camel.apache.org Message-ID: <1452091858463-5775895.post@n5.nabble.com> Subject: PollEnrich + JPA + setCompletionFromBatchConsumer + aggregator MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_198622_378598793.1452091858464" ------=_Part_198622_378598793.1452091858464 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I am using Apache Camel 2.12 (Fuse 6.1). I am trying to use the JPA consumer to consume from a database at every given interval using a timer. I like to consume all of the records that match the search criteria using the aggregator. If the JPA consumer is a standalone route, I can use the aggregate EIP as follows: from ("jpa://com.cigna.upp.model.CustomerAccount?consumer.nativeQuery=" + "SELECT A, B, C, FROM MYTABLE WHERE CLNT_ACCT_NUM='5'" + "&consumeDelete=false" + "&consumer.delay=6000" + "&consumer.resultClass=com.myapp.model.CustomerAccount") .aggregate(constant(true), new GroupedExchangeAggregationStrategy()) .beanRef("jpaRouterHelper","processGroupedExchanges") .setCompletionFromBatchConsumer(true) Given the above route, I will get all records that match the search criteria using the GroupedExchangeAggregationStrategy(). That is, by the time my bean "jpaRouterHelper.processGroupedExchanges" is called, I can process all of the Exchanges using the Exchange.GROUPED_EXCHANGE. I would like to do the same within a pollEnrich. But there is no way to tell pollEnrich to set the setCompletionFromBatchConsumer() so that I will get all of the record. I can set a timeout on the .pollEnrich(resourceUri, timeout, aggregationStrategy). The following is the route that I have: from ("timer://jpaTimer?fixedRate=true&period=10s") .pollEnrich ( "jpa://com.cigna.upp.model.CustomerAccount?consumer.nativeQuery=" + "SELECT A, B, C, FROM MYTABLE WHERE CLNT_ACCT_NUM='5'" + "&consumeDelete=false" + "&consumer.resultClass=com.myapp.model.CustomerAccount", new GroupedExchangeAggregationStrategy()) .beanRef("jpaRouterHelper","processGroupedExchanges") How would I get all of the records using the pollEnrich using the completion from batch consumer? Or should I be approaching this differently? Any help is greatly appreciated. thanks, sunil. -- View this message in context: http://camel.465427.n5.nabble.com/PollEnrich-JPA-setCompletionFromBatchConsumer-aggregator-tp5775895.html Sent from the Camel Development mailing list archive at Nabble.com. ------=_Part_198622_378598793.1452091858464--