Skip to content

Commit

Permalink
Merge pull request #30556 from tsegismont/remove_deprecation_reactive…
Browse files Browse the repository at this point in the history
…_sql

Remove deprecated reactive datasource config properties
  • Loading branch information
gsmet authored Feb 6, 2023
2 parents 9797028 + 116d5a6 commit 5925a26
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,6 @@ public class DataSourceReactiveRuntimeConfig {
@ConfigItem
public PfxConfiguration keyCertificatePfx = new PfxConfiguration();

/**
* Deprecated: this was removed and is no longer available.
*
* @Deprecated
*/
@ConfigItem
@Deprecated
public Optional<Boolean> threadLocal = Optional.empty();

/**
* The number of reconnection attempts when a pooled connection cannot be established on first try.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ private DB2Pool initialize(Vertx vertx,
// io.quarkus.micrometer.runtime.binder.vertx.VertxMeterBinderAdapter.extractClientName
connectOptions.setMetricsName("db2|" + dataSourceName);

if (dataSourceReactiveRuntimeConfig.threadLocal.isPresent()) {
log.warn(
"Configuration element 'thread-local' on Reactive datasource connections is deprecated and will be ignored. The started pool will always be based on a per-thread separate pool now.");
}
return createPool(vertx, poolOptions, connectOptions, dataSourceName);
}

Expand Down Expand Up @@ -161,13 +157,7 @@ private DB2ConnectOptions toConnectOptions(DataSourceRuntimeConfig dataSourceRun
}
}

if (dataSourceReactiveDB2Config.cachePreparedStatements.isPresent()) {
log.warn(
"datasource.reactive.db2.cache-prepared-statements is deprecated, use datasource.reactive.cache-prepared-statements instead");
connectOptions.setCachePreparedStatements(dataSourceReactiveDB2Config.cachePreparedStatements.get());
} else {
connectOptions.setCachePreparedStatements(dataSourceReactiveRuntimeConfig.cachePreparedStatements);
}
connectOptions.setCachePreparedStatements(dataSourceReactiveRuntimeConfig.cachePreparedStatements);

connectOptions.setSsl(dataSourceReactiveDB2Config.ssl);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
package io.quarkus.reactive.db2.client.runtime;

import java.util.Optional;

import io.quarkus.runtime.annotations.ConfigGroup;
import io.quarkus.runtime.annotations.ConfigItem;

@ConfigGroup
public class DataSourceReactiveDB2Config {

/**
* Whether prepared statements should be cached on the client side.
*
* @deprecated use {@code datasource.reactive.cache-prepared-statements} instead.
*/
@ConfigItem
@Deprecated
public Optional<Boolean> cachePreparedStatements = Optional.empty();

/**
* Whether SSL/TLS is enabled.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ private MSSQLPool initialize(Vertx vertx,
// io.quarkus.micrometer.runtime.binder.vertx.VertxMeterBinderAdapter.extractClientName
mssqlConnectOptions.setMetricsName("mssql|" + dataSourceName);

if (dataSourceReactiveRuntimeConfig.threadLocal.isPresent()) {
log.warn(
"Configuration element 'thread-local' on Reactive datasource connections is deprecated and will be ignored. The started pool will always be based on a per-thread separate pool now.");
}
return createPool(vertx, poolOptions, mssqlConnectOptions, dataSourceName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
@ConfigGroup
public class DataSourceReactiveMySQLConfig {

/**
* Whether prepared statements should be cached on the client side.
*
* @deprecated use {@code datasource.reactive.cache-prepared-statements} instead.
*/
@ConfigItem
@Deprecated
public Optional<Boolean> cachePreparedStatements = Optional.empty();

/**
* Charset for connections.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ private MySQLPool initialize(Vertx vertx,
// io.quarkus.micrometer.runtime.binder.vertx.VertxMeterBinderAdapter.extractClientName
mysqlConnectOptions.setMetricsName("mysql|" + dataSourceName);

if (dataSourceReactiveRuntimeConfig.threadLocal.isPresent()) {
log.warn(
"Configuration element 'thread-local' on Reactive datasource connections is deprecated and will be ignored. The started pool will always be based on a per-thread separate pool now.");
}
return createPool(vertx, poolOptions, mysqlConnectOptions, dataSourceName);
}

Expand Down Expand Up @@ -166,13 +162,7 @@ private MySQLConnectOptions toMySQLConnectOptions(DataSourceRuntimeConfig dataSo
}
}

if (dataSourceReactiveMySQLConfig.cachePreparedStatements.isPresent()) {
log.warn(
"datasource.reactive.mysql.cache-prepared-statements is deprecated, use datasource.reactive.cache-prepared-statements instead");
mysqlConnectOptions.setCachePreparedStatements(dataSourceReactiveMySQLConfig.cachePreparedStatements.get());
} else {
mysqlConnectOptions.setCachePreparedStatements(dataSourceReactiveRuntimeConfig.cachePreparedStatements);
}
mysqlConnectOptions.setCachePreparedStatements(dataSourceReactiveRuntimeConfig.cachePreparedStatements);

if (dataSourceReactiveMySQLConfig.charset.isPresent()) {
mysqlConnectOptions.setCharset(dataSourceReactiveMySQLConfig.charset.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ private OraclePool initialize(Vertx vertx,
// io.quarkus.micrometer.runtime.binder.vertx.VertxMeterBinderAdapter.extractClientName
oracleConnectOptions.setMetricsName("oracle|" + dataSourceName);

if (dataSourceReactiveRuntimeConfig.threadLocal.isPresent()) {
log.warn(
"Configuration element 'thread-local' on Reactive datasource connections is deprecated and will be ignored. The started pool will always be based on a per-thread separate pool now.");
}
return createPool(vertx, poolOptions, oracleConnectOptions, dataSourceName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
@ConfigGroup
public class DataSourceReactivePostgreSQLConfig {

/**
* Whether prepared statements should be cached on the client side.
*
* @deprecated use {@code datasource.reactive.cache-prepared-statements} instead.
*/
@ConfigItem
@Deprecated
public Optional<Boolean> cachePreparedStatements = Optional.empty();

/**
* The maximum number of inflight database commands that can be pipelined.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ private PgPool initialize(Vertx vertx,
// See io.quarkus.micrometer.runtime.binder.vertx.VertxMeterBinderAdapter.extractPrefix and
// io.quarkus.micrometer.runtime.binder.vertx.VertxMeterBinderAdapter.extractClientName
pgConnectOptions.setMetricsName("postgresql|" + dataSourceName);
if (dataSourceReactiveRuntimeConfig.threadLocal.isPresent()) {
log.warn(
"Configuration element 'thread-local' on Reactive datasource connections is deprecated and will be ignored. The started pool will always be based on a per-thread separate pool now.");
}

return createPool(vertx, poolOptions, pgConnectOptions, dataSourceName);
}

Expand Down Expand Up @@ -161,14 +158,7 @@ private PgConnectOptions toPgConnectOptions(DataSourceRuntimeConfig dataSourceRu
}
}

if (dataSourceReactivePostgreSQLConfig.cachePreparedStatements.isPresent()) {
log.warn(
"datasource.reactive.postgresql.cache-prepared-statements is deprecated, use datasource.reactive.cache-prepared-statements instead");
pgConnectOptions
.setCachePreparedStatements(dataSourceReactivePostgreSQLConfig.cachePreparedStatements.get());
} else {
pgConnectOptions.setCachePreparedStatements(dataSourceReactiveRuntimeConfig.cachePreparedStatements);
}
pgConnectOptions.setCachePreparedStatements(dataSourceReactiveRuntimeConfig.cachePreparedStatements);

if (dataSourceReactivePostgreSQLConfig.pipeliningLimit.isPresent()) {
pgConnectOptions.setPipeliningLimit(dataSourceReactivePostgreSQLConfig.pipeliningLimit.getAsInt());
Expand Down

0 comments on commit 5925a26

Please sign in to comment.