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

Use *MongoDbContainer* instead of *MongoDBContainer* test containers class in ConnectorConfiguration class

XMLWordPrintable

    • False
    • None
    • False

          public static ConnectorConfiguration forMongoDbContainer(MongoDBContainer mongoDbContainer) {
              final List<Integer> exposedPorts = mongoDbContainer.getExposedPorts();
      
              ConnectorConfiguration configuration = new ConnectorConfiguration();
              configuration.with(CONNECTOR, "io.debezium.connector.mongodb.MongoDbConnector")
                      .with(HOSTS, "rs0/" + mongoDbContainer.getContainerInfo().getConfig().getHostName()
                              + ":" + exposedPorts.get(0))
                      .with(AUTO_DISCOVER_MEMBERS, false);
      
              return configuration;
          }
      

      Modify the forMongoDbContainer method to use connection string and use the io.debezium.testing.testcontainers.MongoDbContainer class in the method parameter.

              anmohant Anisha Mohanty
              anmohant Anisha Mohanty
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: