{"record":{"id":"b1762bf60f2e9a61","repo":"apache/seatunnel","slug":"reconnect-timeout-must-be-greater-than-0-got-r","errorCode":null,"errorMessage":"reconnect_timeout must be greater than 0, got: ${reconnectTimeout}","messagePattern":"reconnect_timeout must be greater than 0, got: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-mqtt/src/main/java/org/apache/seatunnel/connectors/seatunnel/mqtt/source/MqttSourceConfig.java","lineNumber":77,"sourceCode":"                    \"client_id is required when clean_session=false for MQTT source\");\n        }\n        this.clientId =\n                isBlank(configuredClientId)\n                        ? CLIENT_ID_PREFIX + UUID.randomUUID().toString()\n                        : configuredClientId;\n\n        validate();\n    }\n\n    private void validate() {\n        if (qos < 0 || qos > 1) {\n            throw new IllegalArgumentException(\"MQTT source qos must be 0 or 1, got: \" + qos);\n        }\n        if (!\"json\".equalsIgnoreCase(format) && !\"text\".equalsIgnoreCase(format)) {\n            throw new IllegalArgumentException(\"Unsupported MQTT source format: \" + format);\n        }\n        if (reconnectTimeout <= 0) {\n            throw new IllegalArgumentException(\n                    \"reconnect_timeout must be greater than 0, got: \" + reconnectTimeout);\n        }\n        if (maxQueueSize <= 0) {\n            throw new IllegalArgumentException(\n                    \"max_queue_size must be greater than 0, got: \" + maxQueueSize);\n        }\n    }\n\n    private static boolean isBlank(String value) {\n        return value == null || value.trim().isEmpty();\n    }\n\n    public String getUrl() {\n        return url;\n    }\n\n    public String getTopic() {\n        return topic;","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-mqtt/src/main/java/org/apache/seatunnel/connectors/seatunnel/mqtt/source/MqttSourceConfig.java#L59-L95","documentation":"MqttSourceConfig.validate throws IllegalArgumentException when reconnect_timeout is zero or negative. The value controls how long the source waits before attempting a reconnect after a lost MQTT connection, so it must be a positive duration. Validation fails fast at source construction.","triggerScenarios":"Setting reconnect_timeout = 0 or a negative number in the MQTT source config; also caused by unit mistakes (passing milliseconds where seconds expected, or vice versa, producing 0 after truncation).","commonSituations":"Copy-paste of option names with wrong units; users trying to 'disable' reconnection by setting 0 (not permitted); template configs with placeholder 0 values never replaced.","solutions":["Set reconnect_timeout to a positive value in the expected unit (e.g. 5000 for 5s if ms)","Do not attempt to disable reconnection via this option — set it to a sane retry interval instead","Verify units against MqttSourceOptions.RECONNECT_TIMEOUT definition in docs"],"exampleFix":"// before\nMqtt {\n  reconnect_timeout = 0\n}\n// after\nMqtt {\n  reconnect_timeout = 5000\n}","handlingStrategy":"validation","validationCode":"if (reconnectTimeout <= 0) {\n  throw new IllegalArgumentException(\"reconnect_timeout must be > 0, got: \" + reconnectTimeout);\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Verify the time unit documented for reconnect_timeout before setting it","Never use 0 or negatives to 'disable' reconnection","Replace placeholder values in copied templates"],"tags":["mqtt","reconnect","validation","config"],"backgroundTag":"invalid-config-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}