{"record":{"id":"8a8afeddd0a28d00","repo":"quarkusio/quarkus","slug":"annotation-value-cannot-be-blank-offending-me","errorCode":null,"errorMessage":"@${annotation} value cannot be blank. Offending method is: ${method}","messagePattern":"@(.+?) value cannot be blank\\. Offending method is: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/QuarkusMediatorConfigurationUtil.java","lineNumber":361,"sourceCode":"        }\n        try {\n            return Class.forName(className, false, cl);\n        } catch (ClassNotFoundException e) {\n            throw new IllegalStateException(e);\n        }\n    }\n\n    private static String getValue(MethodInfo methodInfo, DotName dotName) {\n        AnnotationInstance annotationInstance = methodInfo.annotation(dotName);\n        String value = null;\n\n        if (annotationInstance != null) {\n            if (annotationInstance.value() != null) {\n                value = annotationInstance.value().asString();\n\n            }\n            if ((value == null) || value.isEmpty()) {\n                throw new IllegalArgumentException(\n                        \"@\" + dotName.withoutPackagePrefix() + \" value cannot be blank. Offending method is: \"\n                                + fullMethodName(methodInfo));\n            }\n\n            // TODO: does it make sense to validate the name with the supplied configuration?\n        }\n\n        return value;\n    }\n\n    private static List<String> getValues(MethodInfo methodInfo, DotName dotName) {\n        return methodInfo.annotations().stream().filter(ai -> ai.name().equals(dotName))\n                .map(ai -> ai.value().asString())\n                .collect(Collectors.toList());\n    }\n\n    private static List<String> getIncomingValues(MethodInfo methodInfo) {\n        return methodInfo.annotations().stream().filter(ai -> ai.name().equals(INCOMINGS))","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/QuarkusMediatorConfigurationUtil.java#L343-L379","documentation":"Quarkus Reactive Messaging validates annotations like @Channel, @Connector or @Emitter on mediator methods: their value must be a non-empty string. During deployment, getValue reads the annotation instance's value; if it is absent, null, or empty it aborts the build with this IllegalArgumentException naming the offending method. It exists to fail fast instead of producing a mediator with an unusable/unnamed target.","triggerScenarios":"Annotating a method with @Channel/@Connector/@Emitter (or similar) with no value, e.g. @Channel or @Channel(\"\") on an @Incoming/@Outgoing method.","commonSituations":"Refactoring away a literal string and leaving the annotation empty; generating code/templates with placeholder annotation values left blank; copying an annotation example that used a named parameter you removed.","solutions":["Give the annotation an explicit non-blank value, e.g. @Channel(\"prices\").","If the channel name is configured externally, still supply the value (Quarkus can map it via configuration like mp.messaging.outgoing.<name>.connector).","Remove the annotation entirely if it is not needed.","Check the method named in the message for other empty-value annotations."],"exampleFix":"// before\n@Outgoing(\"\"\n)\nMulti<String> emit() { ... }\n// after\n@Outgoing(\"my-channel\")\nMulti<String> emit() { ... }","handlingStrategy":"validation","validationCode":"fun validateChannelValue(annotation: Annotation?): Boolean =\n    when (annotation) {\n        is Channel -> annotation.value.isNotBlank()\n        else -> true\n    }\n// Ensure every @Channel/@Connector/@Emitter has a non-blank value before build.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never write @Channel() or @Channel(\"\") — always pass a literal or constant.","Extract channel names into constants so blanks are caught at compile time.","Run a deployment build (mvn quarkus:dev) early to catch annotation validation errors."],"tags":["quarkus","reactive-messaging","deployment","validation"],"backgroundTag":"blank-required-annotation-value","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}