From 7e559c01e17add16753c9f6d55bf6089c6e344b5 Mon Sep 17 00:00:00 2001 From: Ozan Gunalp Date: Wed, 27 Nov 2024 01:35:05 +0100 Subject: [PATCH] Messaging RunOnVirtualThreads fix on class annotation (cherry picked from commit 0bd5d2abdeebc1c765378c760203b1b8c30a5167) --- .../deployment/QuarkusMediatorConfigurationUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/QuarkusMediatorConfigurationUtil.java b/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/QuarkusMediatorConfigurationUtil.java index fa8858dca6380..281340f8238a6 100644 --- a/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/QuarkusMediatorConfigurationUtil.java +++ b/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/QuarkusMediatorConfigurationUtil.java @@ -204,7 +204,8 @@ && hasBlockingPayloadSignature(methodInfo)) { AnnotationInstance transactionalAnnotation = methodInfo.annotation(TRANSACTIONAL); AnnotationInstance runOnVirtualThreadAnnotation = methodInfo.annotation(RUN_ON_VIRTUAL_THREAD); // IF @RunOnVirtualThread is used on the declaring class, it forces all @Blocking method to be run on virtual threads. - AnnotationInstance runOnVirtualThreadClassAnnotation = methodInfo.declaringClass().annotation(RUN_ON_VIRTUAL_THREAD); + AnnotationInstance runOnVirtualThreadClassAnnotation = methodInfo.declaringClass() + .declaredAnnotation(RUN_ON_VIRTUAL_THREAD); if (blockingAnnotation != null || smallryeBlockingAnnotation != null || transactionalAnnotation != null || runOnVirtualThreadAnnotation != null) { mediatorConfigurationSupport.validateBlocking(validationOutput);