Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8063

Persistent tail tracking picks random tail tracker from mongoDB collection

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.13.1
    • Fix Version/s: 2.15.0
    • Component/s: camel-mongodb
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      There is a bug the method "initialize" in "MongoDbTailTrackingManager.java":

      ...
      if (trackingObj == null)

      { dbCol.insert(filter, WriteConcern.SAFE); trackingObj = dbCol.findOne(); }

      ...

      If no tail tracking object exists in the database, a new one will be inserted (that's okay), but the query "dbCol.findOne()" fetches ANY tail tracking object from the database (and not the one we've just inserted).

      In my oppinition, this is a bug and should be corrected like this:
      ...
      DBObject filter = new BasicDBObject("persistentId", config.persistentId);
      trackingObj = dbCol.findOne(filter);
      if (trackingObj == null)

      { dbCol.insert(filter, WriteConcern.SAFE); trackingObj = 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-tracking-with-concurrent-tailable-consumers-td5759131.html

      Best regards,
      Joerg Peschke

        Attachments

          Activity

            People

            • Assignee:
              njiang Willem Jiang
              Reporter:
              jpeschke Jörg Peschke
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: