{"record":{"id":"b61e7aea76e95719","repo":"apache/seatunnel","slug":"unsupported-mqtt-sink-format","errorCode":null,"errorMessage":"Unsupported MQTT sink format: ","messagePattern":"Unsupported MQTT sink format: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-mqtt/src/main/java/org/apache/seatunnel/connectors/seatunnel/mqtt/sink/MqttSinkWriter.java","lineNumber":254,"sourceCode":"            options.setPassword(password.toCharArray());\n        }\n        return options;\n    }\n\n    private static SerializationSchema createSerializationSchema(\n            SeaTunnelRowType rowType, ReadonlyConfig config) {\n        String format = config.get(MqttSinkOptions.FORMAT);\n        switch (format.toLowerCase()) {\n            case \"json\":\n                return new JsonSerializationSchema(rowType);\n            case \"text\":\n                String delimiter = config.get(MqttSinkOptions.FIELD_DELIMITER);\n                return TextSerializationSchema.builder()\n                        .seaTunnelRowType(rowType)\n                        .delimiter(delimiter)\n                        .build();\n            default:\n                throw new IllegalArgumentException(\"Unsupported MQTT sink format: \" + format);\n        }\n    }\n}\n","sourceCodeStart":236,"sourceCodeEnd":258,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-mqtt/src/main/java/org/apache/seatunnel/connectors/seatunnel/mqtt/sink/MqttSinkWriter.java#L236-L258","documentation":"Thrown by createSerializationSchema in MqttSinkWriter when the configured sink 'format' does not match any supported serialization schema (e.g. json/text). Only formats with a builder case in the switch are accepted. IllegalArgumentException means the config value is not part of the supported set.","triggerScenarios":"Setting format in the MQTT sink config to a value other than those handled by the switch (default branch reached), causing MqttSinkWriter construction to fail immediately.","commonSituations":"Typo in format (e.g. 'jsonl', 'csv'); copying a format value valid for other connectors; casing assumptions — the sink switch may be case-sensitive even when docs show lowercase.","solutions":["Set format to one of the supported sink values exactly as handled in MqttSinkWriter (e.g. json, text)","Check docs/en for connector-mqtt sink format options and allowed values","Fix typos and match casing exactly as the option expects","If you need a new format, add a case in createSerializationSchema with the appropriate schema builder"],"exampleFix":"// before\nformat = csv\n// after\nformat = text\n# or\nformat = json","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"json\", \"text\");\nif (!supported.contains(format.trim().toLowerCase())) {\n  throw new IllegalArgumentException(\"Unsupported MQTT sink format: \" + format);\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Validate format values against docs before submitting the job config","Use config templates with a fixed enum of allowed formats","Add a unit test asserting supported format values in MqttSinkWriter"],"tags":["mqtt","config","format","unsupported-value"],"backgroundTag":"invalid-enum-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"}