{"record":{"id":"49e2b13b3bd32283","repo":"conductor-oss/conductor","slug":"exchange-name-is-undefined","errorCode":null,"errorMessage":"Exchange name is undefined","messagePattern":"Exchange name is undefined","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/AMQPObservableQueue.java","lineNumber":558,"sourceCode":"        return getOrCreateExchange(\n                connectionType,\n                settings.getQueueOrExchangeName(),\n                settings.getExchangeType(),\n                settings.isDurable(),\n                settings.autoDelete(),\n                settings.getArguments());\n    }\n\n    private AMQP.Exchange.DeclareOk getOrCreateExchange(\n            ConnectionType connectionType,\n            String name,\n            final String type,\n            final boolean isDurable,\n            final boolean autoDelete,\n            final Map<String, Object> arguments)\n            throws Exception {\n        if (StringUtils.isEmpty(name)) {\n            throw new RuntimeException(\"Exchange name is undefined\");\n        }\n        if (StringUtils.isEmpty(type)) {\n            throw new RuntimeException(\"Exchange type is undefined\");\n        }\n        Channel chn = null;\n        try {\n            LOGGER.debug(\"Creating exchange {} of type {}\", name, type);\n            chn =\n                    amqpConnection.getOrCreateChannel(\n                            connectionType, getSettings().getQueueOrExchangeName());\n            return chn.exchangeDeclare(name, type, isDurable, autoDelete, arguments);\n        } catch (final Exception e) {\n            LOGGER.warn(\"Failed to create exchange {} of type {}\", name, type, e);\n            throw e;\n        } finally {\n            if (chn != null) {\n                try {\n                    amqpConnection.returnChannel(connectionType, chn);","sourceCodeStart":540,"sourceCodeEnd":576,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/AMQPObservableQueue.java#L540-L576","documentation":"Thrown as RuntimeException by getOrCreateExchange when the exchange 'name' argument is empty (StringUtils.isEmpty). The name comes from settings.getQueueOrExchangeName(), which is parsed out of the AMQP queue URI. An empty name means the URI produced no usable exchange identifier, so the broker cannot be asked to declare an exchange.","triggerScenarios":"An AMQP event-queue URI with type amqp_exchange but an empty name segment (e.g. 'amqp_exchange:?exchangeType=topic'), or a URI that the regex accepted but whose 'name' capture group is blank. Occurs during queue initialization at startup or when an exchange-typed observer is first built.","commonSituations":"Misconfigured conductor.workflow.event-queues property; a templated/property-placeholder URI where the exchange name variable was never substituted; copy-paste of a queue URI with the name accidentally deleted.","solutions":["Check the AMQP event-queue URI in conductor config: it must contain a non-empty exchange name after 'amqp_exchange:'.","Verify no property placeholder (${...}) was left unresolved — an empty substitution yields an empty name.","Use the documented form: amqp_exchange:myExchange?exchangeType=topic&routingKey=myRoutingKey.","Add a startup validation/log of the resolved URI so the empty name is visible before the broker call."],"exampleFix":"// before\namqp_exchange:?exchangeType=topic\n// after\namqp_exchange:myExchange?exchangeType=topic","handlingStrategy":"validation","validationCode":"import org.apache.commons.lang3.StringUtils;\nString exchangeName = settings.getQueueOrExchangeName();\nif (useExchange && StringUtils.isBlank(exchangeName)) {\n    throw new IllegalStateException(\n        \"AMQP exchange URI must include a non-empty exchange name; resolved URI=\" + queueURI);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the parsed exchange name is non-blank before calling getOrCreateExchange.","Log the resolved URI at startup so an empty name is visible immediately.","Ensure no property placeholder feeding the exchange name is left unresolved."],"tags":["amqp","configuration","validation","queue"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}