From 37dce40a77b888bc8f676c2d0eb4bff93b6fb22c Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Wed, 6 Sep 2023 13:51:43 +0200 Subject: Change from RESTEasy Classic to RESTEasy Reactive. Change-Id: I3a3386c3a3a380b8217ac1667cc623625aeee532 --- pom.xml | 10 +++------- .../eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java | 2 ++ .../java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java | 2 ++ src/main/java/eu/mulk/mulkcms2/benki/login/LoginResource.java | 2 ++ .../eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java | 2 ++ .../java/eu/mulk/mulkcms2/benki/posts/AllPostsResource.java | 2 ++ src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java | 2 ++ src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java | 2 ++ 8 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 45a8db7..8a2226b 100644 --- a/pom.xml +++ b/pom.xml @@ -174,19 +174,15 @@ io.quarkus - quarkus-resteasy + quarkus-resteasy-reactive io.quarkus - quarkus-resteasy-jsonb + quarkus-resteasy-reactive-jsonb io.quarkus - quarkus-resteasy-mutiny - - - io.quarkus - quarkus-resteasy-qute + quarkus-resteasy-reactive-qute io.quarkus diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java index 4d08298..40f7166 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkResource.java @@ -12,6 +12,7 @@ import eu.mulk.mulkcms2.benki.posts.PostResource; import io.quarkus.qute.CheckedTemplate; import io.quarkus.qute.TemplateInstance; import io.quarkus.security.Authenticated; +import io.smallrye.common.annotation.Blocking; import jakarta.json.JsonObject; import jakarta.transaction.Transactional; import jakarta.validation.constraints.NotEmpty; @@ -38,6 +39,7 @@ import javax.annotation.CheckForNull; import org.jsoup.Jsoup; @Path("/bookmarks") +@Blocking public class BookmarkResource extends PostResource { @CheckedTemplate(basePath = "benki/bookmarks") diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java index e93f7de..45c7f4d 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatResource.java @@ -8,6 +8,7 @@ import eu.mulk.mulkcms2.benki.posts.Post; import eu.mulk.mulkcms2.benki.posts.PostFilter; import eu.mulk.mulkcms2.benki.posts.PostResource; import io.quarkus.security.Authenticated; +import io.smallrye.common.annotation.Blocking; import jakarta.transaction.Transactional; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.Consumes; @@ -26,6 +27,7 @@ import java.time.OffsetDateTime; import java.util.Objects; @Path("/lazychat") +@Blocking public class LazychatResource extends PostResource { public LazychatResource() throws NoSuchAlgorithmException { diff --git a/src/main/java/eu/mulk/mulkcms2/benki/login/LoginResource.java b/src/main/java/eu/mulk/mulkcms2/benki/login/LoginResource.java index d51e77c..17139eb 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/login/LoginResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/login/LoginResource.java @@ -1,6 +1,7 @@ package eu.mulk.mulkcms2.benki.login; import io.quarkus.security.Authenticated; +import io.smallrye.common.annotation.Blocking; import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.GET; import jakarta.ws.rs.HeaderParam; @@ -10,6 +11,7 @@ import java.net.URI; import java.net.URISyntaxException; @Path("/login") +@Blocking public class LoginResource { @GET diff --git a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java index cceddb1..5e8614f 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterResource.java @@ -5,6 +5,7 @@ import static jakarta.ws.rs.core.MediaType.TEXT_HTML; import io.quarkus.mailer.MailTemplate.MailTemplateInstance; import io.quarkus.qute.CheckedTemplate; import io.quarkus.qute.TemplateInstance; +import io.smallrye.common.annotation.Blocking; import jakarta.transaction.Transactional; import jakarta.ws.rs.FormParam; import jakarta.ws.rs.GET; @@ -17,6 +18,7 @@ import java.util.concurrent.CompletionStage; @Path("/newsletter") @Produces(TEXT_HTML) +@Blocking public class NewsletterResource { @CheckedTemplate diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/AllPostsResource.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/AllPostsResource.java index b934408..ebcbfcd 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/posts/AllPostsResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/AllPostsResource.java @@ -1,9 +1,11 @@ package eu.mulk.mulkcms2.benki.posts; +import io.smallrye.common.annotation.Blocking; import jakarta.ws.rs.Path; import java.security.NoSuchAlgorithmException; @Path("/posts") +@Blocking public class AllPostsResource extends PostResource { public AllPostsResource() throws NoSuchAlgorithmException { diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java index 0be31d7..c8090ba 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java @@ -25,6 +25,7 @@ import io.quarkus.mailer.MailTemplate.MailTemplateInstance; import io.quarkus.qute.CheckedTemplate; import io.quarkus.qute.TemplateInstance; import io.quarkus.security.identity.SecurityIdentity; +import io.smallrye.common.annotation.Blocking; import io.smallrye.mutiny.Uni; import jakarta.annotation.Nullable; import jakarta.inject.Inject; @@ -72,6 +73,7 @@ import org.eclipse.microprofile.config.inject.ConfigProperty; import org.hibernate.Session; import org.jsoup.Jsoup; +@Blocking public abstract class PostResource { private static final String hashcashDigestAlgorithm = "SHA-256"; diff --git a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java index 1ca77ca..42f7c63 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java @@ -9,6 +9,7 @@ import io.quarkus.qute.CheckedTemplate; import io.quarkus.qute.TemplateInstance; import io.quarkus.security.Authenticated; import io.quarkus.security.identity.SecurityIdentity; +import io.smallrye.common.annotation.Blocking; import jakarta.inject.Inject; import jakarta.json.JsonObject; import jakarta.json.spi.JsonProvider; @@ -32,6 +33,7 @@ import org.jsoup.Jsoup; import org.jsoup.safety.Safelist; @Path("/wiki") +@Blocking public class WikiResource { private static final JsonProvider jsonProvider = JsonProvider.provider(); -- cgit v1.2.3