{"record":{"id":"01cb78132304153c","repo":"aeron-io/aeron","slug":"invalid-responsecorrelationid-must-be-a-number-greater-than","errorCode":null,"errorMessage":"invalid responseCorrelationId, must be a number greater than or equal to -1, or '<PROTOTYPE_CORRELATION_ID>'","messagePattern":"invalid responseCorrelationId, must be a number greater than or equal to -1, or '<PROTOTYPE_CORRELATION_ID>'","errorType":"exception","errorClass":"InvalidChannelException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java","lineNumber":590,"sourceCode":"        if (PROTOTYPE_CORRELATION_ID.equals(idStr))\n        {\n            return PROTOTYPE_VALUE_CORRELATION_ID;\n        }\n\n        try\n        {\n            final long value = Long.parseLong(idStr);\n\n            if (value < -1)\n            {\n                throw new NumberFormatException(\"responseCorrelationId must be positive\");\n            }\n\n            return value;\n        }\n        catch (final NumberFormatException ex)\n        {\n            throw new InvalidChannelException(\"invalid \" + RESPONSE_CORRELATION_ID_PARAM_NAME +\n                \", must be a number greater than or equal to -1, or '\" + PROTOTYPE_CORRELATION_ID + \"'\", ex);\n        }\n    }\n\n    private static long parseEntityTag(\n        final String tagParam, final DriverConductor driverConductor, final ChannelUri channelUri)\n    {\n        final long entityTag;\n        try\n        {\n            entityTag = Long.parseLong(tagParam);\n        }\n        catch (final NumberFormatException ex)\n        {\n            throw new InvalidChannelException(\"invalid entity tag, must be a number\", ex);\n        }\n\n        if (INVALID_TAG == entityTag)","sourceCodeStart":572,"sourceCodeEnd":608,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java#L572-L608","documentation":"parseResponseCorrelationId parses the `response-correlation-id` URI parameter (for MDS/route-to-response publications) and throws InvalidChannelException on NumberFormatException when the value is not a number >= -1 and not the PROTOTYPE_CORRELATION_ID sentinel.","triggerScenarios":"Adding a publication whose channel URI contains `response-correlation-id=<value>` where value is non-numeric, empty, or numerically less than -1 (e.g. -5), and it is not the prototype sentinel value.","commonSituations":"Plugging a subscription's registrationId captured before publication creation; copying a UUID or hex string instead of a decimal long; template placeholders like `${corrId}` left unsubstituted; sign/overflow mistakes.","solutions":["Set response-correlation-id to a valid decimal long >= -1, typically a live image/subscription correlation id obtained from the driver","Use the PROTOTYPE_CORRELATION_ID sentinel if only declaring a prototype response publication","Omit the parameter entirely if response routing is not needed","Validate the value with Long.parseLong and a >= -1 check before building the URI"],"exampleFix":"// before\n\"aeron:udp?endpoint=localhost:40456|response-correlation-id=-42\"\n// after\n\"aeron:udp?endpoint=localhost:40456|response-correlation-id=123456789\"","handlingStrategy":"validation","validationCode":"long v;\ntry { v = Long.parseLong(value.trim()); }\ncatch (NumberFormatException e) { throw new IllegalArgumentException(\"response-correlation-id must be numeric\"); }\nif (v < -1) throw new IllegalArgumentException(\"response-correlation-id must be >= -1\");","typeGuard":"boolean isValidResponseCorrelationId(String v) {\n    try { long x = Long.parseLong(v.trim()); return x >= -1; } catch (NumberFormatException e) { return false; }\n}","tryCatchPattern":"try { publication = aeron.addPublication(uri, streamId); }\ncatch (InvalidChannelException e) {\n    if (e.getMessage().contains(\"response-correlation-id\")) {\n        throw new ConfigurationException(\"response-correlation-id must be a number >= -1 or the prototype sentinel\", e);\n    } throw e;\n}","preventionTips":["Capture the correlation id from an existing live image/subscription, not a pre-creation id","Use ChannelUriStringBuilder typed setters for this param","Keep the PROTOTYPE_CORRELATION_ID sentinel in a shared constant"],"tags":["aeron","channel-uri","response-correlation-id","validation"],"backgroundTag":"invalid-argument-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"}