{"record":{"id":"ef4229020ccd7286","repo":"aeron-io/aeron","slug":"ttl-must-be-a-value-integer","errorCode":null,"errorMessage":"'ttl' must be a value integer","messagePattern":"'ttl' must be a value integer","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java","lineNumber":580,"sourceCode":"     * @see CommonContext#TTL_PARAM_NAME\n     */\n    public ChannelUriStringBuilder ttl(final ChannelUri channelUri)\n    {\n        final String ttlValue = channelUri.get(TTL_PARAM_NAME);\n        if (null == ttlValue)\n        {\n            ttl = null;\n            return this;\n        }\n        else\n        {\n            try\n            {\n                return ttl(Integer.valueOf(ttlValue));\n            }\n            catch (final NumberFormatException ex)\n            {\n                throw new IllegalArgumentException(\"'ttl' must be a value integer\", ex);\n            }\n        }\n    }\n\n    /**\n     * Get the Time To Live (TTL) for a multicast datagram.\n     *\n     * @return the Time To Live (TTL) for a multicast datagram.\n     * @see CommonContext#TTL_PARAM_NAME\n     */\n    public Integer ttl()\n    {\n        return ttl;\n    }\n\n    /**\n     * Set the maximum transmission unit (MTU) including Aeron header for a datagram payload. If this is greater\n     * than the network MTU for UDP then the packet will be fragmented and can amplify the impact of loss.","sourceCodeStart":562,"sourceCodeEnd":598,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java#L562-L598","documentation":"Thrown by the builder's ttl(String) parse path when the 'ttl' URI parameter value cannot be parsed as an integer. The original NumberFormatException is wrapped as an IllegalArgumentException so callers get a consistent builder validation exception.","triggerScenarios":"ttlUriParameterValue(\"fast\") or a URI containing ttl=abc passed through builder.ttl(...String...) — Integer.valueOf throws NumberFormatException which is rethrown with this message.","commonSituations":"Hand-edited channel URIs with a non-numeric ttl; environment/config substitution that injects an empty or placeholder string; copying a URI with a malformed query parameter.","solutions":["Correct the URI parameter so ttl is a decimal integer, e.g. aeron:udp?ttl=16.","Validate the string with Integer.parseInt in a guard before building.","Strip default/placeholder values from config before constructing the URI."],"exampleFix":"// before\nbuilder.ttl(uri.get(\"ttl\")); // ttl=fast\n// after\nString v = uri.get(\"ttl\");\nif (v != null && v.matches(\"\\\\d+\")) builder.ttl(v);","handlingStrategy":"validation","validationCode":"String v = uriParam(\"ttl\");\nif (v != null && !v.matches(\"\\\\d+\")) { throw new IllegalArgumentException(\"'ttl' must be a value integer\"); }","typeGuard":"boolean isIntegerString(String s) { if (s == null || s.isEmpty()) return false; try { Integer.parseInt(s); return true; } catch (NumberFormatException e) { return false; } }","tryCatchPattern":"try { builder.ttl(rawTtl); } catch (IllegalArgumentException e) { /* fall back to default ttl */ }","preventionTips":["Validate URI query parameters with a regex before building","Ensure config templating substitutes numeric values, not placeholders","Parse parameters through ChannelUri and check types early"],"tags":["aeron","channel-uri","parsing","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"}