Pass encrypt property to Debezium MS SQL Server JDBC URL
Fixes
@@ -24,6 +24,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
@Path("/debezium-sqlserver")
@ApplicationScoped
@@ -34,6 +35,9 @@ public class DebeziumSqlserverResource extends AbstractDebeziumResource {
public static final String DB_NAME = "testDB";
+ @ConfigProperty(name = "sqlserver.encrypt", defaultValue = "false")
+ Boolean encryptConnection;
+
@Inject
Config config;
@@ -65,6 +69,7 @@ public class DebeziumSqlserverResource extends AbstractDebeziumResource {
String offsetStorageFileName) {
return super.getEndpoinUrl(hostname, port, username, password, databaseServerName, offsetStorageFileName)
+ "&databaseDbname=" + DB_NAME
- + "&databaseHistoryFileFilename=" + config.getValue(PROPERTY_DB_HISTORY_FILE, String.class);
+ + "&databaseHistoryFileFilename=" + config.getValue(PROPERTY_DB_HISTORY_FILE, String.class)
+ + "&additionalProperties.database.encrypt=" + encryptConnection;
}
}
