{"record":{"id":"563c6c051c07b0d6","repo":"quarkusio/quarkus","slug":"method-class-method-is-suspendable-but-kotli","errorCode":null,"errorMessage":"Method ${class}.${method} is suspendable but kotlinx-coroutines-jdk8 dependency not detected","messagePattern":"Method (.+?)\\.(.+?) is suspendable but kotlinx-coroutines-jdk8 dependency not detected","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/SmallRyeReactiveMessagingProcessor.java","lineNumber":620,"sourceCode":"                            \"io.quarkus.smallrye.reactivemessaging.runtime.kotlin.ApplicationCoroutineScope\")\n                    .setUnremovable().build());\n        }\n    }\n\n    @BuildStep\n    void configCustomizer(BuildProducer<ServiceProviderBuildItem> serviceProvider) {\n        // Config mapping between SmallRye / MP and Quarkus\n        serviceProvider.produce(ServiceProviderBuildItem\n                .allProvidersFromClassPath(ReactiveMessagingConfigBuilderCustomizer.class.getName()));\n    }\n\n    private void ensureKotlinCoroutinesEnabled(CoroutineConfigurationBuildItem coroutineConfigurationBuildItem,\n            MethodInfo method) {\n        if (!coroutineConfigurationBuildItem.isEnabled()) {\n            String format = String.format(\n                    \"Method %s.%s is suspendable but kotlinx-coroutines-jdk8 dependency not detected\",\n                    method.declaringClass().name(), method.name());\n            throw new IllegalStateException(format);\n        }\n    }\n\n    public static final class CoroutineConfigurationBuildItem extends SimpleBuildItem {\n        private final boolean isEnabled;\n\n        public CoroutineConfigurationBuildItem(boolean isEnabled) {\n            this.isEnabled = isEnabled;\n        }\n\n        public boolean isEnabled() {\n            return isEnabled;\n        }\n    }\n\n    @BuildStep\n    void duplicatedContextSupport(CombinedIndexBuildItem index, BuildProducer<AdditionalBeanBuildItem> beans,\n            BuildProducer<AnnotationsTransformerBuildItem> transformations) {","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/SmallRyeReactiveMessagingProcessor.java#L602-L638","documentation":"A Kotlin suspend mediator method was found, but the kotlinx-coroutines-jdk8 dependency (provided by quarkus-kotlin / coroutine CDI support) is not on the classpath, so Quarkus cannot build the coroutine invoker. The deployment fails with the offending class/method named.","triggerScenarios":"Using `suspend` in a Reactive Messaging mediator class in a project that lacks quarkus-kotlin (or kotlinx-coroutines) dependency, so CoroutineConfigurationBuildItem.isEnabled() is false.","commonSituations":"Adding Kotlin reactive-messaging code to a Java-first app without adding quarkus-kotlin; removing the kotlinx-coroutines-jdk8 dependency during dependency cleanup.","solutions":["Add the quarkus-kotlin extension dependency (which brings kotlinx-coroutines-jdk8).","Explicitly add org.jetbrains.kotlinx:kotlinx-coroutines-jdk8 to the pom.xml/build.gradle.","Remove `suspend` from the method if coroutines are not intended."],"exampleFix":"// before\n<dependency>io.quarkus:quarkus-smallrye-reactive-messaging</dependency>\n// after\n<dependency>io.quarkus:quarkus-smallrye-reactive-messaging</dependency>\n<dependency>io.quarkus:quarkus-kotlin</dependency>","handlingStrategy":"validation","validationCode":"// pom.xml check before adding suspend mediators:\n// <dependency>\n//   <groupId>io.quarkus</groupId>\n//   <artifactId>quarkus-kotlin</artifactId>\n// </dependency>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whenever an app contains Kotlin code, add quarkus-kotlin.","Do not remove kotlinx-coroutines-jdk8 from the dependency tree without auditing suspend usage.","Run mvn dependency:tree | grep coroutines to confirm presence."],"tags":["kotlin","coroutines","missing-dependency","quarkus","reactive-messaging"],"backgroundTag":"missing-dependency","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}