From 71533450ed44466decd4de29f0b121c895faeaec Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Mon, 24 May 2021 13:51:36 +0200 Subject: [PATCH] Vertx Logger and ConfigProperties was deprecated --- .../main/java/io/quarkus/qe/GreetingResource.java | 2 +- .../quarkus/qe/config/AntagonistConfiguration.java | 12 +++++++----- .../config/interfaces/ProtagonistConfigurable.java | 4 ++-- .../vertx/webclient/config/VertxWebClientConfig.java | 4 ++-- .../qe/kafka/config/VertxKProducerConfig.java | 8 ++++---- .../java/io/quarkus/qe/vertx/web/auth/AuthN.java | 6 +++--- .../io/quarkus/qe/vertx/web/config/AuthNConfig.java | 12 ++++++++++-- .../io/quarkus/qe/vertx/web/config/JwtClaims.java | 10 ---------- .../java/io/quarkus/qe/vertx/sql/Application.java | 4 ++-- 9 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/config/JwtClaims.java diff --git a/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/GreetingResource.java b/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/GreetingResource.java index 4a60eb4b..2adb044c 100644 --- a/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/GreetingResource.java +++ b/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/GreetingResource.java @@ -62,7 +62,7 @@ public String helloAntagonist() { @Path("/antagonist/wife") @Produces(MediaType.TEXT_PLAIN) public String helloAntagonistWife() { - return antagonist.wife.name + " says: " + antagonist.wife.message; + return antagonist.wife.name() + " says: " + antagonist.wife.message(); } @GET diff --git a/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/config/AntagonistConfiguration.java b/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/config/AntagonistConfiguration.java index 749a2fe9..313bc9f4 100644 --- a/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/config/AntagonistConfiguration.java +++ b/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/config/AntagonistConfiguration.java @@ -1,15 +1,17 @@ package io.quarkus.qe.config; -import io.quarkus.arc.config.ConfigProperties; +import io.smallrye.config.ConfigMapping; -@ConfigProperties(prefix = "antagonist") +@ConfigMapping(prefix = "antagonist") public class AntagonistConfiguration { public String message; public String name; public AntagonistWifeConfig wife; - public static class AntagonistWifeConfig { - public String name; - public String message; + // TODO: https://github.com/quarkusio/quarkus/issues/17545 + public interface AntagonistWifeConfig { + String name(); + + String message(); } } diff --git a/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/config/interfaces/ProtagonistConfigurable.java b/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/config/interfaces/ProtagonistConfigurable.java index e9eaba42..b531e696 100644 --- a/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/config/interfaces/ProtagonistConfigurable.java +++ b/022-quarkus-properties-config-all/src/main/java/io/quarkus/qe/config/interfaces/ProtagonistConfigurable.java @@ -2,9 +2,9 @@ import org.eclipse.microprofile.config.inject.ConfigProperty; -import io.quarkus.arc.config.ConfigProperties; +import io.smallrye.config.ConfigMapping; -@ConfigProperties(prefix = "protagonist") +@ConfigMapping(prefix = "protagonist") public interface ProtagonistConfigurable extends IBiography { @ConfigProperty(name = "name") diff --git a/300-quarkus-vertx-webClient/src/main/java/io/quarkus/qe/vertx/webclient/config/VertxWebClientConfig.java b/300-quarkus-vertx-webClient/src/main/java/io/quarkus/qe/vertx/webclient/config/VertxWebClientConfig.java index 5116953d..847df745 100644 --- a/300-quarkus-vertx-webClient/src/main/java/io/quarkus/qe/vertx/webclient/config/VertxWebClientConfig.java +++ b/300-quarkus-vertx-webClient/src/main/java/io/quarkus/qe/vertx/webclient/config/VertxWebClientConfig.java @@ -2,9 +2,9 @@ import org.eclipse.microprofile.config.inject.ConfigProperty; -import io.quarkus.arc.config.ConfigProperties; +import io.smallrye.config.ConfigMapping; -@ConfigProperties(prefix = "vertx.webclient") +@ConfigMapping(prefix = "vertx.webclient") public class VertxWebClientConfig { @ConfigProperty(name = "timeoutSec") diff --git a/301-quarkus-vertx-kafka/src/main/java/io/quarkus/qe/kafka/config/VertxKProducerConfig.java b/301-quarkus-vertx-kafka/src/main/java/io/quarkus/qe/kafka/config/VertxKProducerConfig.java index 0d8d4b8c..13ae62bf 100644 --- a/301-quarkus-vertx-kafka/src/main/java/io/quarkus/qe/kafka/config/VertxKProducerConfig.java +++ b/301-quarkus-vertx-kafka/src/main/java/io/quarkus/qe/kafka/config/VertxKProducerConfig.java @@ -2,15 +2,15 @@ import org.eclipse.microprofile.config.inject.ConfigProperty; -import io.quarkus.arc.config.ConfigProperties; +import io.smallrye.config.ConfigMapping; -@ConfigProperties(prefix = "vertx.kafka.producer") +@ConfigMapping(prefix = "vertx.kafka.producer") public class VertxKProducerConfig { - @ConfigProperty(name = "delayMs") + @ConfigProperty(name = "delay-ms") public long delay; - @ConfigProperty(name = "batchSize") + @ConfigProperty(name = "batch-size") public int batchSize; } diff --git a/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/auth/AuthN.java b/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/auth/AuthN.java index 82c1ec07..0703987e 100644 --- a/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/auth/AuthN.java +++ b/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/auth/AuthN.java @@ -39,9 +39,9 @@ private PubSecKeyOptions getPubSecKeyOptions() { private JWTOptions getJwtOptions() { return new JWTOptions() .setIgnoreExpiration(false) - .setIssuer(authNConf.claims.iss) - .setAudience(Arrays.asList((authNConf.claims.aud))) - .setSubject(authNConf.claims.sub) + .setIssuer(authNConf.claims.iss()) + .setAudience(Arrays.asList((authNConf.claims.aud()))) + .setSubject(authNConf.claims.sub()) .setExpiresInMinutes(authNConf.liveSpan) .setAlgorithm(authNConf.alg); } diff --git a/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/config/AuthNConfig.java b/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/config/AuthNConfig.java index ee49a6a2..97b4bc74 100644 --- a/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/config/AuthNConfig.java +++ b/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/config/AuthNConfig.java @@ -2,9 +2,9 @@ import org.eclipse.microprofile.config.inject.ConfigProperty; -import io.quarkus.arc.config.ConfigProperties; +import io.smallrye.config.ConfigMapping; -@ConfigProperties(prefix = "authN") +@ConfigMapping(prefix = "authN") public class AuthNConfig { public String alg; @@ -15,4 +15,12 @@ public class AuthNConfig { @ConfigProperty(name = "jwt.claims") public JwtClaims claims; + + public interface JwtClaims { + String iss(); + + String sub(); + + String aud(); + } } diff --git a/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/config/JwtClaims.java b/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/config/JwtClaims.java deleted file mode 100644 index 2e5177e9..00000000 --- a/302-quarkus-vertx-jwt/src/main/java/io/quarkus/qe/vertx/web/config/JwtClaims.java +++ /dev/null @@ -1,10 +0,0 @@ -package io.quarkus.qe.vertx.web.config; - -import io.quarkus.arc.config.ConfigProperties; - -@ConfigProperties(prefix = "authN.jwt.claims") -public class JwtClaims { - public String iss; - public String sub; - public String aud; -} diff --git a/303-quarkus-vertx-sql/src/main/java/io/quarkus/qe/vertx/sql/Application.java b/303-quarkus-vertx-sql/src/main/java/io/quarkus/qe/vertx/sql/Application.java index 553bfd21..466e5c13 100644 --- a/303-quarkus-vertx-sql/src/main/java/io/quarkus/qe/vertx/sql/Application.java +++ b/303-quarkus-vertx-sql/src/main/java/io/quarkus/qe/vertx/sql/Application.java @@ -17,9 +17,9 @@ import io.quarkus.qe.vertx.sql.services.DbPoolService; import io.quarkus.runtime.StartupEvent; import io.quarkus.runtime.configuration.ProfileManager; +import io.vertx.core.impl.logging.Logger; +import io.vertx.core.impl.logging.LoggerFactory; import io.vertx.core.json.jackson.DatabindCodec; -import io.vertx.core.logging.Logger; -import io.vertx.core.logging.LoggerFactory; import io.vertx.mutiny.db2client.DB2Pool; import io.vertx.mutiny.mysqlclient.MySQLPool; import io.vertx.mutiny.pgclient.PgPool;