{"record":{"id":"8fee2040bd6d31a0","repo":"apache/seatunnel","slug":"max-queue-size-must-be-greater-than-0-got-maxq","errorCode":null,"errorMessage":"max_queue_size must be greater than 0, got: ${maxQueueSize}","messagePattern":"max_queue_size 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":81,"sourceCode":"                        ? 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;\n    }\n\n    public String getUsername() {\n        return username;","sourceCodeStart":63,"sourceCodeEnd":99,"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#L63-L99","documentation":"MqttSourceConfig.validate throws IllegalArgumentException when max_queue_size is zero or negative. This option bounds the internal buffer of messages between the MQTT client callback and the reader; it must be positive for the buffer to function. Failure occurs at source construction, before any network I/O.","triggerScenarios":"Setting max_queue_size = 0 or negative in the MQTT source config; placeholder values in templates; integer overflow attempts via very large negative inputs.","commonSituations":"Users trying to disable buffering by setting 0 (not supported); mis-scaled values when tuning memory; copied configs from connectors where 0 means unbounded.","solutions":["Set max_queue_size to a positive integer (e.g. 1000)","Tune based on expected throughput and backpressure tolerance rather than setting it to 0","Check docs for default value if unsure and remove the explicit option to use the default"],"exampleFix":"// before\nMqtt {\n  max_queue_size = 0\n}\n// after\nMqtt {\n  max_queue_size = 1000\n}","handlingStrategy":"validation","validationCode":"if (maxQueueSize <= 0) {\n  throw new IllegalArgumentException(\"max_queue_size must be > 0, got: \" + maxQueueSize);\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Treat max_queue_size as a tuning knob, not an on/off switch","Start from the documented default and adjust based on throughput tests","Guard config pipelines against placeholder 0 values"],"tags":["mqtt","queue","validation","config"],"backgroundTag":"value-out-of-range","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"}