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);