{"record":{"id":"cee93ef62fa9d375","repo":"apache/seatunnel","slug":"s-must-be-configured-when-s-is-used","errorCode":null,"errorMessage":"'%s' must be configured when '%s' is used","messagePattern":"'(.+?)' must be configured when '(.+?)' is used","errorType":"validation","errorClass":"OptionValidationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-rabbitmq/src/main/java/org/apache/seatunnel/connectors/seatunnel/rabbitmq/config/RabbitmqSingleTableValidator.java","lineNumber":45,"sourceCode":" * <p>This validator is invoked by {@code ConfigValidator} through {@code\n * Conditions.extension(QUEUE_NAME, ...)} before {@code RabbitmqSource} is constructed.\n */\npublic class RabbitmqSingleTableValidator implements ConditionExtension<String> {\n\n    private static final String SCHEMA_KEY = RabbitmqBaseOptions.SCHEMA.key();\n    private static final String QUEUE_NAME_KEY = RabbitmqBaseOptions.QUEUE_NAME.key();\n\n    @Override\n    public String description() {\n        return \"requires '\" + SCHEMA_KEY + \"' to be configured\";\n    }\n\n    @Override\n    public boolean evaluate(ReadonlyConfig config, String queueName)\n            throws OptionValidationException {\n\n        if (!config.getOptional(RabbitmqBaseOptions.SCHEMA).isPresent()) {\n            throw new OptionValidationException(\n                    \"'%s' must be configured when '%s' is used\", SCHEMA_KEY, QUEUE_NAME_KEY);\n        }\n\n        return true;\n    }\n}\n","sourceCodeStart":27,"sourceCodeEnd":52,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-rabbitmq/src/main/java/org/apache/seatunnel/connectors/seatunnel/rabbitmq/config/RabbitmqSingleTableValidator.java#L27-L52","documentation":"RabbitmqSingleTableValidator.evaluate throws OptionValidationException saying the schema option must be configured when queue-name is used. When a single-table RabbitMQ source config supplies queue-name, a root-level schema is mandatory so the reader knows the row structure.","triggerScenarios":"Config contains queue-name (or the validator is evaluated for a queue) but the root-level schema option is absent, i.e. config.getOptional(SCHEMA) is empty.","commonSituations":"Copy-pasted config where tables-configs examples were adapted to single-queue mode but schema was dropped; user assumed schema could be inferred; upgrading from an older connector version that had different required options.","solutions":["Add the required schema option at the root of the RabbitMQ source config","If multiple queues with different schemas are needed, switch to tables-configs and remove root-level schema/queue-name conflict (see tables-configs validator)","Consult the connector documentation for the exact schema syntax (SeaTunnel SeaTunnelRowType format)"],"exampleFix":"// before\nsource {\n  RabbitMQ {\n    queue-name = \"orders\"\n  }\n}\n// after\nsource {\n  RabbitMQ {\n    queue-name = \"orders\"\n    schema = {\n      fields {\n        id = int\n        name = string\n      }\n    }\n  }\n}","handlingStrategy":"validation","validationCode":"ReadonlyConfig cfg = ReadonlyConfig.fromMap(jobConfig);\nif (cfg.getOptional(RabbitmqBaseOptions.QUEUE_NAME).isPresent()\n    && !cfg.getOptional(RabbitmqBaseOptions.SCHEMA).isPresent()) {\n  throw new IllegalArgumentException(\"queue-name requires a root-level schema\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  validator.evaluate(config, queueName);\n} catch (OptionValidationException e) {\n  System.err.println(\"Fix config: \" + e.getMessage()); // tells you which option is missing\n}","preventionTips":["Always pair queue-name with a schema block in single-table mode","Validate configs with the connector validators before submission","Keep an example working config per mode (single vs tables-configs)"],"tags":["rabbitmq","config","validation","schema"],"backgroundTag":"missing-required-config-field","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"}