{"record":{"id":"ef205a5a7b26c211","repo":"aeron-io/aeron","slug":"max-resend-param-name-must-be-a-number","errorCode":null,"errorMessage":"${MAX_RESEND_PARAM_NAME} must be a number","messagePattern":"(.+?) must be a number","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java","lineNumber":2327,"sourceCode":"     * @see CommonContext#MAX_RESEND_PARAM_NAME\n     */\n    public ChannelUriStringBuilder maxResend(final ChannelUri channelUri)\n    {\n        final String valueStr = channelUri.get(MAX_RESEND_PARAM_NAME);\n        if (null == valueStr)\n        {\n            this.maxResend = null;\n            return this;\n        }\n        else\n        {\n            try\n            {\n                return maxResend(Integer.parseInt(valueStr));\n            }\n            catch (final NumberFormatException ex)\n            {\n                throw new IllegalArgumentException(MAX_RESEND_PARAM_NAME + \" must be a number\", ex);\n            }\n        }\n    }\n\n    /**\n     * The max number of retransmit actions.\n     *\n     * @return the max number of outstanding retransmit actions\n     * @see CommonContext#MAX_RESEND_PARAM_NAME\n     */\n    public Integer maxResend()\n    {\n        return maxResend;\n    }\n\n    /**\n     * The stream id of the channel.\n     *","sourceCodeStart":2309,"sourceCodeEnd":2345,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java#L2309-L2345","documentation":"Thrown when the max_resend channel URI parameter cannot be parsed as an integer. ChannelUriStringBuilder expects max_resend (max number of retransmit actions) to be a plain integer; any other string raises this IllegalArgumentException, with the original NumberFormatException as the cause.","triggerScenarios":"Building/parsing a channel URI containing max_resend=<non-integer>, e.g. max_resend=3.5, max_resend=unlimited, or an empty value via ChannelUriStringBuilder.","commonSituations":"Writing 'unlimited' or 'default' instead of a number; float values where an int was expected; empty value after config substitution; whitespace around the number.","solutions":["Set max_resend to a plain integer literal, e.g. max_resend=8.","Trim the value and remove any whitespace, units, or comments before URI parsing.","Validate the parameter with Integer.parseInt in your config layer and fall back to the default when absent."],"exampleFix":"// before\nString uri = \"aeron:udp?endpoint=localhost:40456|max_resend=unlimited\";\n// after\nString uri = \"aeron:udp?endpoint=localhost:40456|max_resend=8\";","handlingStrategy":"validation","validationCode":"int parseMaxResend(String value) {\n    try {\n        return Integer.parseInt(value.trim());\n    } catch (NumberFormatException e) {\n        throw new IllegalArgumentException(\"max_resend must be an integer, got: '\" + value + \"'\", e);\n    }\n}","typeGuard":"boolean isValidMaxResend(String value) {\n    try {\n        Integer.parseInt(value.trim());\n        return true;\n    } catch (NumberFormatException e) {\n        return false;\n    }\n}","tryCatchPattern":"try {\n    builder.maxResend(Integer.parseInt(valueStr));\n} catch (NumberFormatException e) {\n    log.warn(\"max_resend '{}' not a number, using default\", valueStr);\n    // omit the parameter\n}","preventionTips":["Always pass plain integer literals for max_resend (no units, decimals, or words like 'unlimited').","Trim config values before parsing to avoid whitespace-induced NumberFormatException.","Provide a default in your config layer when the parameter is absent instead of an empty string."],"tags":["aeron","channel-uri","config","number-format"],"backgroundTag":"invalid-argument-format","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}