quarkusio/quarkus · error · IllegalArgumentException
@${annotation} value cannot be blank. Offending method is: $
Error message
@${annotation} value cannot be blank. Offending method is: ${method} What it means
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.
Source
Thrown at extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/QuarkusMediatorConfigurationUtil.java:361
}
try {
return Class.forName(className, false, cl);
} catch (ClassNotFoundException e) {
throw new IllegalStateException(e);
}
}
private static String getValue(MethodInfo methodInfo, DotName dotName) {
AnnotationInstance annotationInstance = methodInfo.annotation(dotName);
String value = null;
if (annotationInstance != null) {
if (annotationInstance.value() != null) {
value = annotationInstance.value().asString();
}
if ((value == null) || value.isEmpty()) {
throw new IllegalArgumentException(
"@" + dotName.withoutPackagePrefix() + " value cannot be blank. Offending method is: "
+ fullMethodName(methodInfo));
}
// TODO: does it make sense to validate the name with the supplied configuration?
}
return value;
}
private static List<String> getValues(MethodInfo methodInfo, DotName dotName) {
return methodInfo.annotations().stream().filter(ai -> ai.name().equals(dotName))
.map(ai -> ai.value().asString())
.collect(Collectors.toList());
}
private static List<String> getIncomingValues(MethodInfo methodInfo) {
return methodInfo.annotations().stream().filter(ai -> ai.name().equals(INCOMINGS))View on GitHub (pinned to e1c734241f)
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.
Example fix
// before
@Outgoing(""
)
Multi<String> emit() { ... }
// after
@Outgoing("my-channel")
Multi<String> emit() { ... } Defensive patterns
Strategy: validation
Validate before calling
fun validateChannelValue(annotation: Annotation?): Boolean =
when (annotation) {
is Channel -> annotation.value.isNotBlank()
else -> true
}
// Ensure every @Channel/@Connector/@Emitter has a non-blank value before build. Prevention
- 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.
When it happens
Trigger: Annotating a method with @Channel/@Connector/@Emitter (or similar) with no value, e.g. @Channel or @Channel("") on an @Incoming/@Outgoing method.
Common situations: 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.
Related errors
- Emitter configuration for channel `${channel}` is different
- @ExactlyOnce on method ${methodName} requires both @Incoming
- name cannot be null
- Either location or predicate must be set
- At least one package name must be specified
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/8a8afeddd0a28d00.
Report an issue: GitHub.