Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-838

Initial synchronization is not interrupted

XMLWordPrintable

      Initial synchronization of MongoDb connector is not interrupted by stopping task:

      io.debezium.connector.mongodb.Replicator.java
      protected long copyCollection(MongoClient primary, CollectionId collectionId, long timestamp) throws InterruptedException {
          ...
          try (MongoCursor<Document> cursor = docCollection.find().iterator()) {
              while (cursor.hasNext()) {
                  Document doc = cursor.next();
                  ...
              }
          }
          ...
      }
      

      I suggest adding the following condition in the while loop:

      while (running.get() && cursor.hasNext())
      

            Unassigned Unassigned
            andrey.pustovetov@gmail.com Andrey Pustovetov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: