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

support mongodb connection string as configuration option

XMLWordPrintable

      While trying out DBZ mongo connector today against Atlas, I realized that the current way to configure the connector regarding DB connection settings is less convenient than it could be. Users have to explicitly specify multiple separate config options, e.g.

      • mongodb.hosts
      • mongodb.user
      • mongodb.password

      and others such as SSL settings. IMHO the easier/"better" way to specify the DB connection settings is to use the connection string URI format which is documented here https://docs.mongodb.com/manual/reference/connection-string/

      There are two formats, standard and DNS seed list. When working with MongoDB Atlas you can directly C&P this from the web UI and it would be nice if the connector supports this as is. For instance, this would be one simple example of such a connection string URI from Atlas:

      mongodb+srv://<user>:<password>@<cluster-subdomain>.azure.mongodb.net/myDB?retryWrites=true&w=majority

      or here in combination with the Java Driver

      ConnectionString connectionString = new ConnectionString("mongodb+srv://<user>:<password>@<cluster-subdomain>.azure.mongodb.net/myDB?retryWrites=true&w=majority");
      MongoClientSettings settings = MongoClientSettings.builder()
              .applyConnectionString(connectionString)
              .build();
      MongoClient mongoClient = MongoClients.create(settings);

            jcechace@redhat.com Jakub Čecháček
            hpgrahsl Hans-Peter Grahsl (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: