flowable/flowable-engine · error · IllegalArgumentException

Invalid priority value for <channelDefinition> (must be an i

Error message

Invalid priority value for <channelDefinition> (must be an integer)

What it means

The channel definition's priority attribute is resolved as a String and must parse to an Integer for the Rabbit listener consumer priority. If it has text but is not a valid integer, resolvePriority throws this IllegalArgumentException (wrapping the NumberFormatException).

Source

Thrown at modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/rabbit/RabbitChannelDefinitionProcessor.java:213

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

    protected RabbitAdmin resolveAdmin(RabbitInboundChannelModel channelDefinition) {
        String rabbitAdmin = resolve(channelDefinition.getAdmin());
        if (StringUtils.hasText(rabbitAdmin)) {
            Assert.state(this.beanFactory != null, "BeanFactory must be set to resolve RabbitAdmin by bean name");
            try {
                return this.beanFactory.getBean(rabbitAdmin, RabbitAdmin.class);
            } catch (NoSuchBeanDefinitionException ex) {
                throw new IllegalArgumentException("Could not register rabbit listener endpoint on [" +
                    channelDefinition + "], no " + RabbitAdmin.class.getSimpleName() + " with id '" +
                    rabbitAdmin + "' was found in the application context", ex);
            }

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Set priority to a valid integer string, e.g. "5" or "-1"
  2. Check the resolved string for hidden whitespace/units and trim it
  3. Remove the priority attribute entirely if you want the default (resolvePriority returns null when blank)
  4. Validate numeric fields at configuration-load time

Example fix

// before
channelDefinition.setPriority("high");
// after
channelDefinition.setPriority("5");
Defensive patterns

Strategy: validation

Validate before calling

String priority = channelDefinition.getPriority();
if (priority != null && !priority.isBlank()) {
    try { Integer.valueOf(priority.trim()); }
    catch (NumberFormatException e) { throw new IllegalArgumentException("priority must be an integer: " + priority); }
}

Try / catch

try {
    processor.process(definition);
} catch (IllegalArgumentException ex) {
    if (ex.getMessage().contains("priority")) {
        log.error("Fix priority in {}: {}", definition, ex.getMessage());
    }
    throw ex;
}

Prevention

When it happens

Trigger: Setting channelDefinition.setPriority("high") or any non-numeric string like "10x", "default", or an expression resolving to non-numeric text, so Integer.valueOf fails.

Common situations: Configuring priority with a word instead of a number; placeholders resolving to values with whitespace or units ("5 "); copying priority formats from other systems (e.g. '0-9 labels'); typos.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/d9a2accab0b6d475. Report an issue: GitHub.