flowable/flowable-engine · error · IllegalArgumentException
Channel definition <channelDefinition> cannot resolve <resol
Error message
Channel definition <channelDefinition> cannot resolve <resolvedValue> as a String[] or a String or a Queue
What it means
Each queue entry in the channel definition is resolved (possibly via SpEL) and must resolve to a String, a String array/iterable, or an org.springframework.amqp.core.Queue. Any other resolved type makes resolveQueues throw this IllegalArgumentException because the endpoint cannot derive queue names from it.
Source
Thrown at modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/rabbit/RabbitChannelDefinitionProcessor.java:202
return resultQueues.toArray(new String[0]);
}
protected void resolveQueues(Object resolvedValue, List<String> result, RabbitInboundChannelModel channelDefinition) {
Object resolvedValueToUse = resolvedValue;
if (resolvedValueToUse instanceof String[]) {
resolvedValueToUse = Arrays.asList((String[]) resolvedValueToUse);
}
if (resolvedValueToUse instanceof String) {
result.add((String) resolvedValueToUse);
} else if (resolvedValueToUse instanceof Queue) {
result.add(((Queue) resolvedValueToUse).getName());
} else if (resolvedValueToUse instanceof Iterable) {
for (Object object : (Iterable<?>) resolvedValueToUse) {
resolveQueues(object, result, channelDefinition);
}
} else {
throw new IllegalArgumentException(
"Channel definition " + channelDefinition + " cannot resolve " + resolvedValue + " as a String[] or a String or a Queue");
}
}
protected Integer resolvePriority(RabbitInboundChannelModel channelDefinition) {
String priority = resolve(channelDefinition.getPriority());
if (StringUtils.hasText(priority)) {
try {
return Integer.valueOf(priority);
} catch (NumberFormatException ex) {
throw new IllegalArgumentException("Invalid priority value for " +
channelDefinition + " (must be an integer)", ex);
}
} else {
return null;
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Change the expression so it resolves to a queue name String (or list of Strings)
- If referencing a bean, reference a Queue bean or a String[]/List<String> bean
- Print/log the resolved value's class to identify the wrong type
- Fix typos in property keys that cause fallback to unintended values
Example fix
// before
"queues": "${queueProps}" // resolves to Map<String,String>
// after
"queues": "${queueNames}" // resolves to List<String> or String[] Defensive patterns
Strategy: validation
Validate before calling
Object resolved = resolveExpression(queueExpr);
if (!(resolved instanceof String) && !(resolved instanceof String[]) && !(resolved instanceof Queue) && !(resolved instanceof Iterable)) {
throw new IllegalArgumentException("Queue expression must resolve to String/String[]/Queue/Iterable, got " + resolved.getClass());
} Type guard
boolean isResolvableQueueValue(Object v) {
return v instanceof String || v instanceof String[] || v instanceof Queue || v instanceof Iterable;
} Try / catch
try {
processor.process(definition);
} catch (IllegalArgumentException ex) {
if (ex.getMessage().contains("cannot resolve")) {
log.error("Queue expression resolves to unsupported type: {}", ex.getMessage());
}
throw ex;
} Prevention
- Point queue expressions only at String, String[], List<String>, or Queue beans
- Log resolved types during development to catch mismatches early
- Avoid loosely typed config (Maps) in queue positions
When it happens
Trigger: A queue expression resolves to an unsupported type, e.g. a Map, Integer, Boolean, or arbitrary bean, when createRabbitListenerEndpoint processes the queues of an inbound Rabbit channel definition.
Common situations: SpEL pointing at the wrong bean or a Map of queue properties instead of names; placeholder resolving to a Number; typo causing resolution to fall through to an unexpected object; nested list of non-String elements.
Related errors
- The [<attribute>] must resolve to a String. Resolved to [<cl
- Queues in <channelDefinition> must not be null
- Invalid priority value for <channelDefinition> (must be an i
- Could not register rabbit listener endpoint on [<channelDefi
- ackMode in definition [ <channelDefinition> ] must resolve t
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/37997a1611d5825f.
Report an issue: GitHub.