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

SQL Server connector database.instance config option is ignored

XMLWordPrintable

      The SQL Server connection exposes a database.instance config option described in the connector documentation as: 

      database.instance       Specifies the instance name of the SQL Server named instance
      

      This config option appears to be ignored when attempting to connect to a SQL Server named instance. For example:

      connection attempt #1 - specify hostname + instance; do not specify port

      {
          "connector.class": "io.debezium.connector.sqlserver.SqlServerConnector",
          "database.hostname": "example.com",
          "database.instance": "my_instance",
          "database.names": "my_database",
          ...
      }
      

      The connector reports:

      kafka-connect       | [2022-12-10 08:47:30,027] TRACE URL: jdbc:sqlserver://example.com:1433;databaseName=my_database (io.debezium.jdbc.JdbcConnection:231)
      

      Connection attempt FAILED:

      • the connector ignores named instance
      • connector uses default port 1433

      connection attempt #2 - specify hostname + instance; specify port = 0

      {
          "connector.class": "io.debezium.connector.sqlserver.SqlServerConnector",
          "database.hostname": "example.com",
          "database.instance": "my_instance",
          "database.port": "0",
          "database.names": "my_database",
          ...
      }
      

      The connector reports:

      kafka-connect       | [2022-12-10 08:47:32,684] TRACE URL: jdbc:sqlserver://example.com:0;databaseName=my_database (io.debezium.jdbc.JdbcConnection:231)
      

      Connection attempt FAILED:

      • the connector ignores named instance

      connection attempt #3 - specify hostname + embedded instance; specify port = 0

      {
          "connector.class": "io.debezium.connector.sqlserver.SqlServerConnector",
          "database.hostname": "example.com\\my_instance",
          "database.port": "0",
          "database.names": "my_database",
          ...
      }
      

      The connector reports:

      kafka-connect       | [2022-12-10 08:51:45,634] TRACE URL: jdbc:sqlserver://example.commy_instance:0;databaseName=my_database (io.debezium.jdbc.JdbcConnection:231)
      

      Connection attempt FAILED:

      • the connector consumes escaped "\" separator resulting in a bogus hostname

      connection attempt #4 - specify hostname + double-embedded instance; specify port = 0

      {
          "connector.class": "io.debezium.connector.sqlserver.SqlServerConnector",
          "database.hostname": "example.com\\\\my_instance",
          "database.port": "0",
          "database.names": "my_database",
          ...
      }
      

      The connector reports:

      kafka-connect       | [2022-12-10 08:53:55,060] TRACE URL: jdbc:sqlserver://dsdb1.sss.co.nz\zen:0;databaseName=zen_arm (io.debezium.jdbc.JdbcConnection:231)
      

      Connection attempt SUCCEEDS:

      • instance name must be included in hostname config parameter
      • double escaping of the "\" separator is required
      • port must be specified as 0

       

              Unassigned Unassigned
              keriharris Keri Harris (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: