Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 983BB10ABC for ; Wed, 19 Nov 2014 12:28:34 +0000 (UTC) Received: (qmail 77380 invoked by uid 500); 19 Nov 2014 12:28:34 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 77221 invoked by uid 500); 19 Nov 2014 12:28:34 -0000 Mailing-List: contact issues-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 issues@camel.apache.org Received: (qmail 77043 invoked by uid 99); 19 Nov 2014 12:28:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Nov 2014 12:28:34 +0000 Date: Wed, 19 Nov 2014 12:28:33 +0000 (UTC) From: =?utf-8?Q?J=C3=B6rg_Peschke_=28JIRA=29?= To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CAMEL-8063) Persistent tail tracking picks random tail tracker from mongoDB collection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 J=C3=B6rg Peschke created CAMEL-8063: ----------------------------------- Summary: Persistent tail tracking picks random tail tracker fr= om mongoDB collection Key: CAMEL-8063 URL: https://issues.apache.org/jira/browse/CAMEL-8063 Project: Camel Issue Type: Bug Components: camel-mongodb Affects Versions: 2.13.1 Reporter: J=C3=B6rg Peschke Priority: Minor There is a bug the method "initialize" in "MongoDbTailTrackingManager.java"= :=20 ... if (trackingObj =3D=3D null) { dbCol.insert(filter, WriteConcern.SAFE); trackingObj =3D dbCol.findOne(); } ... If no tail tracking object exists in the database, a new one will be insert= ed (that's okay), but the query "dbCol.findOne()" fetches ANY tail tracking= object from the database (and not the one we've just inserted).=20 In my oppinition, this is a bug and should be corrected like this:=20 ... DBObject filter =3D new BasicDBObject("persistentId", config.persistentId); trackingObj =3D dbCol.findOne(filter); if (trackingObj =3D=3D null) { dbCol.insert(filter, WriteConcern.SAFE); trackingObj =3D dbCol.findOne(filter); } (not tested). A workaround can be implemented by putting each persistent tail tracker in = it's own collection, so I marked this issue as "minor". More details: http://camel.465427.n5.nabble.com/MongoDB-Persistent-tail-tra= cking-with-concurrent-tailable-consumers-td5759131.html Best regards, Joerg Peschke -- This message was sent by Atlassian JIRA (v6.3.4#6332)