{"record":{"id":"d98bd8d9897b389d","repo":"aeron-io/aeron","slug":"destinations-may-not-specify-control-mode-response","errorCode":null,"errorMessage":"destinations may not specify control-mode=response","messagePattern":"destinations may not specify control-mode=response","errorType":"validation","errorClass":"InvalidChannelException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java","lineNumber":2390,"sourceCode":"    {\n        if (SPY_QUALIFIER.equals(uri.prefix()))\n        {\n            throw new InvalidChannelException(\"Aeron spies are invalid as send destinations: channel=\" +\n                destinationUri);\n        }\n\n        for (final String invalidKey : INVALID_DESTINATION_KEYS)\n        {\n            if (uri.containsKey(invalidKey))\n            {\n                throw new InvalidChannelException(\n                    \"destinations must not contain the key: \" + invalidKey + \" channel=\" + destinationUri);\n            }\n        }\n\n        if (Objects.equals(CONTROL_MODE_RESPONSE, uri.get(MDC_CONTROL_MODE_PARAM_NAME)))\n        {\n            throw new InvalidChannelException(\"destinations may not specify \" +\n                MDC_CONTROL_MODE_PARAM_NAME + \"=\" + CONTROL_MODE_RESPONSE);\n        }\n    }\n\n    private static void validateSendDestinationUri(final ChannelUri uri, final String destinationUri)\n    {\n        final String endpoint = uri.get(ENDPOINT_PARAM_NAME);\n\n        if (null != endpoint && endpoint.endsWith(\":0\"))\n        {\n            throw new InvalidChannelException(ENDPOINT_PARAM_NAME + \" has port=0 for send destination: channel=\" +\n                destinationUri);\n        }\n    }\n\n    @SuppressWarnings({ \"unused\", \"UnnecessaryReturnStatement\" })\n    private static void validateExperimentalFeatures(final boolean enableExperimentalFeatures, final UdpChannel channel)\n    {","sourceCodeStart":2372,"sourceCodeEnd":2408,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java#L2372-L2408","documentation":"A destination URI specifies control-mode=response, which is a property of the owning channel, not of individual destinations. The driver rejects response control mode on destinations with InvalidChannelException.","triggerScenarios":"Calling Publication.addDestination() / MultiDestination setup with a destination URI containing \"control-mode=response\".","commonSituations":"Misunderstanding how response channels work (control-mode=response belongs on the response subscription's channel); generating destination URIs from a response-channel template.","solutions":["Remove control-mode=response from the destination URI; specify it only on the response subscription channel.","Set control-mode=manual or omit control-mode on ordinary destinations.","For response channels, configure response-correlation-id on the response channel itself, not on MDC destinations."],"exampleFix":"// before\npublication.addDestination(\"aeron:udp?endpoint=h:40456|control-mode=response\");\n// after\npublication.addDestination(\"aeron:udp?endpoint=h:40456\");","handlingStrategy":"validation","validationCode":"ChannelUri uri = ChannelUri.parse(destination);\nif (\"response\".equals(uri.get(\"control-mode\"))) throw new IllegalArgumentException(\"destinations may not use control-mode=response\");","typeGuard":"boolean destinationAllowsControlMode(ChannelUri uri) {\n  String mode = uri.get(\"control-mode\");\n  return mode == null || \"manual\".equals(mode) || \"dynamic\".equals(mode);\n}","tryCatchPattern":"try { publication.addDestination(destination); }\ncatch (InvalidChannelException e) { if (e.getMessage().contains(\"control-mode=response\")) { /* remove param from destination */ } else throw e; }","preventionTips":["Apply control-mode=response only on the response subscription channel","Use ChannelUriStringBuilder with per-role allowed params","Keep response-channel logic in a dedicated factory"],"tags":["aeron","destination-uri","control-mode","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}