Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D785018DB6 for ; Mon, 18 Jan 2016 10:16:37 +0000 (UTC) Received: (qmail 66461 invoked by uid 500); 18 Jan 2016 10:16:37 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 66416 invoked by uid 500); 18 Jan 2016 10:16:37 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 66405 invoked by uid 99); 18 Jan 2016 10:16:37 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jan 2016 10:16:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id C0827C0DED for ; Mon, 18 Jan 2016 10:16:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.292 X-Spam-Level: * X-Spam-Status: No, score=1.292 tagged_above=-999 required=6.31 tests=[RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id UsNqnS-JjcU9 for ; Mon, 18 Jan 2016 10:16:29 +0000 (UTC) Received: from smtpgw.sap-ag.de (smtpgw04.sap-ag.de [155.56.66.99]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 0166442BA7 for ; Mon, 18 Jan 2016 10:16:28 +0000 (UTC) From: "Siano, Stephan" To: "users@camel.apache.org" Subject: RE: IdempotentConsumer Query (How does it work) Thread-Topic: IdempotentConsumer Query (How does it work) Thread-Index: AQHRUdZ7X92Gi3yfkEG1lJF84r6aKJ8BDPOA Date: Mon, 18 Jan 2016 10:16:21 +0000 Message-ID: References: <1453110958338-5776387.post@n5.nabble.com> In-Reply-To: <1453110958338-5776387.post@n5.nabble.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.21.40.92] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Hi, The idempotent consumer is not supposed to work on the exchangeId (a new on= e will be generated for each file) but on an identifier from the payload or= some metadata that is unique for the file. One possibility would be that t= he payload itself contains a unique order id or something like that. In tha= t case you want to process the order only once. If you do not have such an entity in your data file, this might become diff= icult. If you are reading files and split them into lines and the filenames= are globally unique (which means that you will never reuse a filename) it = might be possible to get a unique identifier for a line with a clever conca= tenation of CamelFileName and CamelSplitIndex (you must put something in be= tween that is not used in the filename in order to avoid clashes (foo11 cou= ld be filename foo and index 11 or filename foo1 and index 1)). Best regards Stephan -----Original Message----- From: fxthomas [mailto:felix.thomas@gmail.com]=20 Sent: Montag, 18. Januar 2016 10:56 To: users@camel.apache.org Subject: IdempotentConsumer Query (How does it work) hello, =20 I had read the doc at http://camel.apache.org/idempotent-consumer.html.= =20 I have a doubt on how it maintains the uniqueness . I checked the code in DefaultExchange and saw the ExchangeID generated using Instance, Prefix etc= . But I am not sure How it makes the message ID unique and avoid duplicates .= =20 For example :-=20 In my case I have to read a CSV file and process it. But in case of an exception or IO error if the route stops and if I restart the route again i= t should start from the line in CSV which was not read earlier and not processed. The already processed lines should be skipped or ignored since they will be duplicates . I thought of using JDBC based IdempotentConsumer . But I am not sure if it will work fine in this scenario . Any pointer will be helpful to understand. -- View this message in context: http://camel.465427.n5.nabble.com/IdempotentC= onsumer-Query-How-does-it-work-tp5776387.html Sent from the Camel - Users mailing list archive at Nabble.com.