{"record":{"id":"2770df1d752cfe5f","repo":"conductor-oss/conductor","slug":"queue-uri-doesn-t-matches-the-expected-regexp","errorCode":null,"errorMessage":"Queue URI doesn't matches the expected regexp","messagePattern":"Queue URI doesn't matches the expected regexp","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/util/AMQPSettings.java","lineNumber":169,"sourceCode":"     * <p><u>Example for queue:</u>\n     *\n     * <pre>\n     * amqp_queue:myQueue?deliveryMode=1&autoDelete=true&exclusive=true\n     * </pre>\n     *\n     * <u>Example for exchange:</u>\n     *\n     * <pre>\n     * amqp_exchange:myExchange?bindQueueName=myQueue&exchangeType=topic&routingKey=myRoutingKey&exclusive=true\n     * </pre>\n     *\n     * @param queueURI\n     * @return\n     */\n    public final AMQPSettings fromURI(final String queueURI) {\n        final Matcher matcher = URI_PATTERN.matcher(queueURI);\n        if (!matcher.matches()) {\n            throw new IllegalArgumentException(\"Queue URI doesn't matches the expected regexp\");\n        }\n\n        // Set name of queue or exchange from group \"name\"\n        LOGGER.info(\"Queue URI:{}\", queueURI);\n        if (Objects.nonNull(matcher.group(\"type\"))) {\n            type = Type.fromString(matcher.group(\"type\"));\n        }\n        queueOrExchangeName = matcher.group(\"name\");\n        eventName = queueURI;\n        if (matcher.groupCount() > 1) {\n            final String queryParams = matcher.group(\"params\");\n            if (StringUtils.isNotEmpty(queryParams)) {\n                // Handle parameters\n                Arrays.stream(queryParams.split(\"\\\\s*\\\\&\\\\s*\"))\n                        .forEach(\n                                param -> {\n                                    final String[] kv = param.split(\"\\\\s*=\\\\s*\");\n                                    if (kv.length == 2) {","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/util/AMQPSettings.java#L151-L187","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use the conductor queue-URI form: amqp_queue:myName or amqp_exchange:myName?params, NOT amqp://host.","Verify the type prefix uses an underscore (amqp_queue / amqp_exchange), not a colon-scheme.","Strip whitespace/newlines from the configured URI before it reaches fromURI.","Cross-check against the URI_PATTERN regex documented in AMQPSettings."],"exampleFix":"// before\namqp://guest@localhost:5672/myQueue\n// after\namqp_queue:myQueue?durable=true","handlingStrategy":"validation","validationCode":"import java.util.regex.Pattern;\nprivate static final Pattern URI_PATTERN =\n    Pattern.compile(\"^(?<type>amqp_(?:queue|exchange))?:?(?<name>[^?]+)\\\\??(?<params>.*)$\",\n        Pattern.CASE_INSENSITIVE);\nif (!URI_PATTERN.matcher(queueURI).matches()) {\n    throw new IllegalArgumentException(\n        \"Invalid AMQP queue URI (must be amqp_queue:name or amqp_exchange:name?params): \" + queueURI);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not confuse the broker URI (amqp://host) with the conductor queue URI (amqp_queue:name).","Use the underscore form amqp_queue / amqp_exchange.","Strip whitespace from configured URIs before parsing."],"tags":["amqp","configuration","validation","uri"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}