conductor-oss/conductor · error · IllegalArgumentException

Queue URI doesn't matches the expected regexp

Error message

Queue URI doesn't matches the expected regexp

What it means

Thrown as IllegalArgumentException by AMQPSettings.fromURI when the queue URI does not match the expected regex ^(amqp_queue|amqp_exchange)?:name?params$. The regex requires an optional type prefix, a non-empty name segment, and an optional query string. Any URI violating that shape is rejected before parsing.

Source

Thrown at amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/util/AMQPSettings.java:169

     * <p><u>Example for queue:</u>
     *
     * <pre>
     * amqp_queue:myQueue?deliveryMode=1&autoDelete=true&exclusive=true
     * </pre>
     *
     * <u>Example for exchange:</u>
     *
     * <pre>
     * amqp_exchange:myExchange?bindQueueName=myQueue&exchangeType=topic&routingKey=myRoutingKey&exclusive=true
     * </pre>
     *
     * @param queueURI
     * @return
     */
    public final AMQPSettings fromURI(final String queueURI) {
        final Matcher matcher = URI_PATTERN.matcher(queueURI);
        if (!matcher.matches()) {
            throw new IllegalArgumentException("Queue URI doesn't matches the expected regexp");
        }

        // Set name of queue or exchange from group "name"
        LOGGER.info("Queue URI:{}", queueURI);
        if (Objects.nonNull(matcher.group("type"))) {
            type = Type.fromString(matcher.group("type"));
        }
        queueOrExchangeName = matcher.group("name");
        eventName = queueURI;
        if (matcher.groupCount() > 1) {
            final String queryParams = matcher.group("params");
            if (StringUtils.isNotEmpty(queryParams)) {
                // Handle parameters
                Arrays.stream(queryParams.split("\\s*\\&\\s*"))
                        .forEach(
                                param -> {
                                    final String[] kv = param.split("\\s*=\\s*");
                                    if (kv.length == 2) {

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Use the conductor queue-URI form: amqp_queue:myName or amqp_exchange:myName?params, NOT amqp://host.
  2. Verify the type prefix uses an underscore (amqp_queue / amqp_exchange), not a colon-scheme.
  3. Strip whitespace/newlines from the configured URI before it reaches fromURI.
  4. Cross-check against the URI_PATTERN regex documented in AMQPSettings.

Example fix

// before
amqp://guest@localhost:5672/myQueue
// after
amqp_queue:myQueue?durable=true
Defensive patterns

Strategy: validation

Validate before calling

import java.util.regex.Pattern;
private static final Pattern URI_PATTERN =
    Pattern.compile("^(?<type>amqp_(?:queue|exchange))?:?(?<name>[^?]+)\\??(?<params>.*)$",
        Pattern.CASE_INSENSITIVE);
if (!URI_PATTERN.matcher(queueURI).matches()) {
    throw new IllegalArgumentException(
        "Invalid AMQP queue URI (must be amqp_queue:name or amqp_exchange:name?params): " + queueURI);
}

Prevention

When it happens

Trigger: Passing a full amqp://broker URI instead of the conductor queue-URI form; a URI with illegal characters in the name segment; missing or malformed type prefix; a blank URI string.

Common situations: Confusing the broker connection URI (amqp://host:5672) with the conductor event-queue URI (amqp_queue:name); typos like 'amqpqueue:' without underscore; trailing characters that break the name capture.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/2770df1d752cfe5f. Report an issue: GitHub.